Add method to String to check starts with - Node.js String

Node.js examples for String:String Start

Description

Add method to String to check starts with

Demo Code


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

Related Tutorials