unknown 6 жил өмнө
parent
commit
f2c0e53f12

+ 2 - 2
src/jy/clear/specialsymbols.go

@@ -56,7 +56,6 @@ func init() {
 }
 }
 
 
 //去除首尾空格、换行、回车
 //去除首尾空格、换行、回车
-//func RemoveHeadAndEndSpace(str) []interface{} {
 func RemoveHeadAndEndSpace(text string) string {
 func RemoveHeadAndEndSpace(text string) string {
 	defer qu.Catch()
 	defer qu.Catch()
 	if len(text) > 0 {
 	if len(text) > 0 {
@@ -70,7 +69,7 @@ func RemoveHeadAndEndSymmetricCode(val string) string {
 	defer qu.Catch()
 	defer qu.Catch()
 	text := []rune(val)
 	text := []rune(val)
 	if len(text) > 0 {
 	if len(text) > 0 {
-		for i := 1; i <= 2; i++ {
+		for i := 1; i <= 2; i++ { //循环处理两次
 			if len(text) > 0 {
 			if len(text) > 0 {
 				//text = RemoveStart(i, text)
 				//text = RemoveStart(i, text)
 				text = AnotherRemoveStart(text)
 				text = AnotherRemoveStart(text)
@@ -221,6 +220,7 @@ func OtherClean(field, text string) string {
 	if MesField[field].(bool) { //乱码
 	if MesField[field].(bool) { //乱码
 		text = RemoveMessycode(text)
 		text = RemoveMessycode(text)
 	}
 	}
+	text = RemoveHeadAndEndSpace(text) //去除首尾空格
 	return text
 	return text
 }
 }