ddl: fix a bug when format generation expressions. (#5262)

This commit is contained in:
qupeng
2017-12-13 18:57:01 +08:00
committed by Ewan Chou
parent 713bc797bb
commit 81ffef96d7
8 changed files with 94 additions and 55 deletions

View File

@ -14,7 +14,6 @@
package stringutil
import (
"bytes"
"strings"
"unicode/utf8"
@ -235,17 +234,3 @@ func DoMatch(str string, patChars, patTypes []byte) bool {
}
return sIdx == len(str)
}
// RemoveBlanks removes all blanks, returns a new string.
func RemoveBlanks(s string) string {
var buf = new(bytes.Buffer)
var cbuf [6]byte
for _, c := range s {
if c == rune(' ') || c == rune('\t') || c == rune('\r') || c == rune('\n') {
continue
}
len := utf8.EncodeRune(cbuf[0:], c)
buf.Write(cbuf[0:len])
}
return buf.String()
}