javascript regex get first letter code example
Example 1: javascript regex for firstname
var nameRegex = /^[a-zA-Z\-]+$/;
Example 2: js sting first letter
var x = 'some string';
alert(x.charAt(0)); // alerts 's'
var nameRegex = /^[a-zA-Z\-]+$/;
var x = 'some string';
alert(x.charAt(0)); // alerts 's'