|
@@ -58,7 +58,7 @@ func init() {
|
|
|
//去除首尾空格、换行、回车
|
|
|
//func RemoveHeadAndEndSpace(str) []interface{} {
|
|
|
func RemoveHeadAndEndSpace(text string) string {
|
|
|
- qu.Catch()
|
|
|
+ defer qu.Catch()
|
|
|
if len(text) > 0 {
|
|
|
tmp := cutSpace.ReplaceAllString(strings.Replace(text, " ", " ", -1), "")
|
|
|
text = replaceSymbol(tmp, spaces)
|
|
@@ -67,10 +67,10 @@ func RemoveHeadAndEndSpace(text string) string {
|
|
|
}
|
|
|
|
|
|
func RemoveHeadAndEndSymmetricCode(val string) string {
|
|
|
- qu.Catch()
|
|
|
+ defer qu.Catch()
|
|
|
text := []rune(val)
|
|
|
if len(text) > 0 {
|
|
|
- for i := 1; i <= 3; i++ {
|
|
|
+ for i := 1; i <= 2; i++ {
|
|
|
if len(text) > 0 {
|
|
|
//text = RemoveStart(i, text)
|
|
|
text = AnotherRemoveStart(text)
|
|
@@ -81,7 +81,7 @@ func RemoveHeadAndEndSymmetricCode(val string) string {
|
|
|
}
|
|
|
|
|
|
func RemoveStart(i int, text []rune) []rune {
|
|
|
- qu.Catch()
|
|
|
+ defer qu.Catch()
|
|
|
if len(text) > 0 {
|
|
|
airedIndex := make(map[int]int)
|
|
|
surplusMax := -1 //记录多余的反符号最大值
|
|
@@ -190,7 +190,7 @@ func RemoveStart(i int, text []rune) []rune {
|
|
|
|
|
|
//乱码
|
|
|
func RemoveMessycode(text string) string {
|
|
|
- qu.Catch()
|
|
|
+ defer qu.Catch()
|
|
|
if len(text) > 0 {
|
|
|
text = MesReg.ReplaceAllString(text, "")
|
|
|
}
|
|
@@ -199,7 +199,7 @@ func RemoveMessycode(text string) string {
|
|
|
|
|
|
//特殊符号
|
|
|
func RemoveAsymmetric(text string) string {
|
|
|
- qu.Catch()
|
|
|
+ defer qu.Catch()
|
|
|
if len(text) > 0 {
|
|
|
textRune := []rune(text)
|
|
|
first := string(textRune[0])
|
|
@@ -228,7 +228,7 @@ func OtherClean(field, text string) string {
|
|
|
}
|
|
|
|
|
|
func AnotherRemoveStart(text []rune) []rune {
|
|
|
- qu.Catch()
|
|
|
+ defer qu.Catch()
|
|
|
if len(text) > 0 {
|
|
|
airedIndex := make(map[int]int)
|
|
|
surplusMax := -1 //记录多余的反符号最大值
|