To search for a smaller string in a bigger string, use the Contains function:
package main //from www. j av a2 s.c om import ( "fmt" "strings" ) func main() { // Contains(s, substr string) bool fmt.Println(strings.Contains("test", "es")) // => true }
More examples
package main // w ww . ja va2 s . c om import ( "fmt" "strings" ) func main() { fmt.Println(strings.Contains("CSS", "CSS")) fmt.Println(strings.Contains("CSS", "css")) fmt.Println(strings.Contains("CSS", "cs")) }