Check string start with substr - Node.js String

Node.js examples for String:String Start

Description

Check string start with substr

Demo Code


String.prototype.startsWith = function(prefix)
{
    return (this.substr(0, prefix.length) === prefix);
}

Related Tutorials