// Trim
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g, "");
};
// StartsWith
String.prototype.startsWith = function (str) {
return (this.match("^"+str) == str);
}
// EndsWith
String.prototype.endsWith = function (str) {
return (this.match(str + "$") == str);
}
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g, "");
};
// StartsWith
String.prototype.startsWith = function (str) {
return (this.match("^"+str) == str);
}
// EndsWith
String.prototype.endsWith = function (str) {
return (this.match(str + "$") == str);
}
Comments
Post a Comment