Use regex to check string start - Node.js Regular expression

Node.js examples for Regular expression:Match

Description

Use regex to check string start

Demo Code

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

Related Tutorials