remove empty

This commit is contained in:
zhiqiang feng
2020-12-28 16:49:36 +08:00
parent fd41bf4698
commit c9bd9fe11d
+1 -3
View File
@@ -41,7 +41,5 @@ func check() {
}
func removeEmpty(s string) string {
regex, _ := regexp.Compile("\n\n")
s = regex.ReplaceAllString(s, "\n")
return s
return regexp.MustCompile(`[\t\r\n]+`).ReplaceAllString(strings.TrimSpace(s), "\n")
}