indexOf and lastIndexOf simplifications
Merge pull request #1876 from megawac/indexof-s

indexOf and lastIndexOf simplifications