Check String starts with charAt function - Node.js String

Node.js examples for String:String Start

Description

Check String starts with charAt function

Demo Code


String.prototype.startsWith = function startsWith(c){
  if(this.charAt(0) == c){
    return true;/*from w  ww. ja  va  2s . c  o  m*/
  } else {
    return false;
  }
};

Related Tutorials