It goes fater to start comparing from the end of the searching string then from the begining; if the comparred chars do not match, move the search index directly to the possition of that char in the search string; this goes stright if chars do not repeat in the search string; otherwise you have to build a matching helper array somehow...
This is a fastest method I know, and works faster for longer search strings.