Browse Source

过滤空格

maxiaoshan 5 years ago
parent
commit
689add958c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/jy/clear/cutspace.go

+ 1 - 1
src/jy/clear/cutspace.go

@@ -19,7 +19,7 @@ var (
 var spaces = []string{"\u3000", "\u2003", "\u00a0", "\t", "\r", "\n", "\u0001"}
 
 func init() {
-	cutSpace, _ = regexp.Compile(`^\s*|\s*$`)
+	cutSpace, _ = regexp.Compile(`^[\s]*|[\s]*$`)
 	cutAllSpace, _ = regexp.Compile(`\s*`)
 	catSymbol, _ = regexp.Compile(`[]+`)
 	separateSymbol, _ = regexp.Compile("[\\s\u3000\u2003\u00a0\\n,,、/。|]")