javascript slice for string code example
Example 1: string splice
newStr = str.split(''); // or newStr = [...str];
newStr.splice(2,5);
newStr = newStr.join('');
Example 2: cut string from string javascript
var ret = "data-123".replace('data-','');
console.log(ret); //prints: 123