Answers for "golang eliminate duplicate spaces"

Go
0

golang eliminate duplicate spaces

space := regexp.MustCompile(`\s+`)
str := space.ReplaceAllString("Hello  \t \n world!", " ")
fmt.Println(str) // "Hello world!"
Posted by: Guest on August-13-2020

Code answers related to "golang eliminate duplicate spaces"

Browse Popular Code Answers by Language