String Matching
Contributed by
How do you search for a string? If it’s just once, strings.Index(text, pattern) is probably your best option. The standard library currently uses Rabin-Karp to search the text for the pattern. However, there are lots of different cases for string searching, each of which has its own set of “best” algorithms. Fortunately for us, many of them already have implementations in Go. index/suffixarray What if you had a single text you wanted to do lots of searches through for different patterns?