Answers for "how to get a substring between two strings from a string in js"

3

javascript get text between two words

//Gets the part of the string inbetween the : and the ;
var part = str.substring(
    str.lastIndexOf(":") + 1, 
    str.lastIndexOf(";")
);
Posted by: Guest on June-04-2020
0

javascript get text between two strings

var mySubString = str.substring(
    str.lastIndexOf(":") + 1, 
    str.lastIndexOf(";")
);
Posted by: Guest on June-24-2021
0

how to get a substring between two strings from a string in js

//I would use indexOf instead of lastIndexOf, to find the first occurrence of the string
Posted by: Guest on March-24-2021

Code answers related to "how to get a substring between two strings from a string in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language