Capitalize first letter of the provided string and return the modified string. - Node.js String

Node.js examples for String:Case

Description

Capitalize first letter of the provided string and return the modified string.

Demo Code

function sentenceCase( string )
{
  var lower = string.toLowerCase();
  return lower.substr(0,1).toUpperCase() + lower.substr(1);
}

Related Tutorials