Here you can find the source of startsWith(other, case_cmp)
String.prototype.startsWith = function(other, case_cmp) { var first = this; var second = other; if(!case_cmp) { first = first.toLowerCase();// w w w . j a v a2 s . c om second = second.toLowerCase(); } return (first.indexOf(second) === 0); }
String.prototype.startsWith = function (matchString) { if (this == matchString) return true; var matchString = '^' + matchString + '[\x20-\x7E]+$'; var regex = new RegExp(matchString); return !!this.match(regex); };
String.prototype.startsWith = function(needle) { return this.substr(0, needle.length) == needle;
String.prototype.startsWith = function(needle) return(this.indexOf(needle) == 0); };
String.prototype.startsWith = function(needle) { return(this.indexOf(needle) == 0); };
String.prototype.startsWith = function(other) { var length = other.length; if (this.length < length) return false; return this.substring(0, length) == other; };
String.prototype.startsWith = function(pattern) { return this.indexOf(pattern) === 0; };
String.prototype.startsWith = function(pattern) { return (this.substr(0, pattern.length) == pattern); };
String.prototype.startsWith = function(pattern) { return (this.substr(0, pattern.length) === pattern); };
String.prototype.startsWith = function (prefix) { return this.indexOf(prefix) === 0; String.prototype.endsWith = function (suffix) { return this.match(suffix + "$") == suffix; };