get everything after character javascript code example
Example 1: get string after character javascript
const str = '01-01-2020';
// get everything after first dash
const slug = str.substring(str.indexOf('-') + 1); // 01-2020
// get everything after last dash
const slug = str.split('-').pop(); // 2020
Example 2: javascript delete first character in string
var oldStr ="Hello";
var newStr = oldStr.substring(1); //remove first character "ello"