I'm trying to find a clean way to extract a substring from between two other substrings.So far I can do it based on targeting a specific character, but not a string. E.g (this doesn't work)
var element = "Firstconstantmystring_lastconstant";
var mySubString = element.substring(
element.lastIndexOf("Firstconstant") + 1,
element.lastIndexOf("_lastconstant")
);
I'm trying to extract "mystring" from the full string. I know that "Firstconstant" and "_lastconstant" will always be the same. Grateful for any help.