javascript cut string

JavaScript
let str = 'John Wick'
let firstChar = str.charAt(0) 
console.log(firstChar); // "J" var str = "Hello world That is reallly neat!";
var res = str.substring(0, 5);//get first 5 charsvar str = "Hello world!";
var res = str.substring(1, 4); //ellconst string = "0123456789";
console.log(string.slice(0, 2)); // "01"
console.log(string.slice(0, 8)); // "01234567"
console.log(string.slice(3, 7)); // "3456"var ret = "data-123".replace('data-','');
console.log(ret);   //prints: 123
Source

Also in JavaScript: