Tribex/RapidS — pull request #30 by Nateowami (2014-01-16 13:37:40+00:00)
Title: Added String.contains() startsWith() endsWith()

This was a total nightmare. I ended up deleting my copy of your repo twice, re-forking once, and had tons of... you know. Anyway, it works. I don't pretend to understand String.startsWith() works, and I'd already written one for it so I left that alone and put mine in commented out. And I also left the old contains() because your startsWith() function uses it. I added a comment at the top which I'll copy here:

the purpose of all the if statements -example below-
if (typeof String.prototype.startsWith != 'function')
is in case these functions are defined by the JavaScript
interpriter in the future. Defining them when they are already defined can cause
problems and seems to be keeping FireFox (for example) from implementing
String.contains();

And it's late and I'm going to bed. We can comment on this if I need to say more.