Javascript String hasPrefix(str)

Description

Javascript String hasPrefix(str)


//Check if string has specific prefix
String.prototype.hasPrefix = function (str){
    return this.slice(0, str.length) == str;
};



PreviousNext

Related