String.prototype.endsWith

Removed the String.prototype.endsWith and replaced the usage of endsWith
with the actual code.