Answers for "substring javascript after character"

4

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
Posted by: Guest on July-06-2020
1

get everything after the first character javascript

var val = 'asdasd:111122:123123123';
var response = val.substring(val.indexOf(":"));

alert(response); // ":111122:123123123"
Posted by: Guest on September-16-2020
0

javascript substring after character

var testStr = "sometext-20202"
var splitStr = testStr.substring(testStr.indexOf('-') + 1);
Posted by: Guest on February-12-2021
0

javascript substring after character

const str = 'sometext-20202';
const slug = str.split('-').pop();
Posted by: Guest on February-12-2021

Code answers related to "substring javascript after character"

Code answers related to "Javascript"

Browse Popular Code Answers by Language