Answers for "go replace spaces in string"

Go
0

go in a string, replace multiple spaces with single space

whitespaces := regexp.MustCompile(`\s+`)
t := whitespaces.ReplaceAllString(s, " ")
Posted by: Guest on February-24-2021

Code answers related to "go replace spaces in string"

Browse Popular Code Answers by Language