string trim golang code example
Example 1: go remove whitespace from string
randomString := " hello this is a test"
fmt.Println(strings.Replace(randomString, " ", "", -1))
>hellothisisatest
Example 2: golang find in string
// 1. Contains
res := strings.Contains(str, substr)
fmt.Println(res) // true