Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //______________________________________________________________________________
- // ZapBlanks elimina tutti i spazi superflui da una stringa.
- func ZapBlanks(text string) string {
- borders := regexp.MustCompile(`^[\s\p{Zs}]+|[\s\p{Zs}]+$`)
- inner := regexp.MustCompile(`[\s\p{Zs}]{2,}`)
- f := borders.ReplaceAllString(text, "")
- f = inner.ReplaceAllString(f, " ")
- return f
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement