Answers for "go in a string, replace multiple spaces with single space"

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 in a string, replace multiple spaces with single space"

Browse Popular Code Answers by Language