take the first character from string javascript code example
Example 1: javascript get first character of string
var str="Hello Folks!"
var firstStringChar = str.charAt(0); //H
Example 2: cut string from string javascript
var ret = "data-123".replace('data-','');
console.log(ret); //prints: 123