I just read a bit about different string matching algorithms and checked out the implementation of Sun's String.indexOf(). I noticed they implemented the so called 'naive way' instead of, usually, much faster algorithms like the Boyer/Moore one. What reason might behind this implementation decision?How can you be sure that Boyer-Moore is faster? Is Boyer-Moore faster when the key is one character and the string being searched is 200 characters? If your implementation needs Boyer-Moore, you can always implement your own FastSearchString class that uses Boyer-Moore.