File size: 277 Bytes
ca7217f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | package convertor
import (
"strings"
"unicode"
)
// ReplaceSpaceAll removes all spaces in string.
func ReplaceSpaceAll(s string) string {
var b strings.Builder
b.Grow(len(s))
for _, c := range s {
if !unicode.IsSpace(c) {
b.WriteRune(c)
}
}
return b.String()
}
|