Check if given string starts with pattern. - Node.js String

Node.js examples for String:String Start

Description

Check if given string starts with pattern.

Demo Code


String.prototype.startsWith = function(str) 
{
    return (this.match("^"+str) === str);
};

Related Tutorials