$Search: searching for strings
Using [strings.Index](<https://golang.org/pkg/strings/#Index>)
:
https://codeeval.dev/gist/4c312b56d6830c6a5961f876bd0042b3
Above we searched from the beginning of the string. We can also search from the end using [strings.LastIndex](<https://golang.org/pkg/strings/#LastIndex>)
:
https://codeeval.dev/gist/5678a8bc7d172c4c17e27eb74580fb28
Above, we only found the first occurrence of the substring. Here’s how to find all occurrences:
https://codeeval.dev/gist/16ee87e4a408f7eee71a13dfa441b17c
Using [strings.Contains](<https://golang.org/pkg/strings/#Contains>)
:
https://codeeval.dev/gist/5ce0127165d333511302b27334c555e6
Using [strings.HasPrefix](<https://golang.org/pkg/strings/#HasPrefix>)
:
https://codeeval.dev/gist/19a7e8b4d87bda8dc5cb4a6eac6eed10
Using [strings.HasSuffix](<https://golang.org/pkg/strings/#HasSuffix>)
: