What is the fastest way to strip all whitespace from some arbitrary string in Go.
I am chaining two function from the string package:
response = stri
I found the simplest way would be to use strings.ReplaceAll like so:
randomString := " hello this is a test" fmt.Println(strings.ReplaceAll(randomString, " ", "")) >hellothisisatest
Playground