1const str = '01-01-2020';
2
3// get everything after first dash
4const slug = str.substring(str.indexOf('-') + 1); // 01-2020
5
6// get everything after last dash
7const slug = str.split('-').pop(); // 2020
1var val = 'asdasd:111122:123123123';
2var response = val.substring(val.indexOf(":"));
3
4alert(response); // ":111122:123123123"