/ Published in: JavaScript
A simple Javascript function to tell if one string starts with another.
Usage:
if (myString.startsWith("anything") { do something… }
NOTE: As always, make sure this is defined before it is used!
Expand |
Embed | Plain Text
if (typeof String.prototype.startsWith != 'function') { String.prototype.startsWith = function(str) { return (this.lastIndexOf(str, 0) === 0); }; }
Comments
Subscribe to comments
You need to login to post a comment.

I just have the same idea, Are you searching for finest Cheap Hermes Birkin ? buy Original Leather Hermes Bags Online Sale, 100% guaranteed, you could come to our store and find one handbags you love. and we will tell you Hermes latest news from Hermes Birkin blog.