I want to return the the last folder in which the wav file is inside:
So if we have this URL:
const dec = "https://langfox.ir/expect/sources/frozen_2019/the_beautiful_forest_version_1/are you enjoying your new frozen layer/1614282551749614446037f2253780f2f.wav";
We should return exactly:
are you enjoying your new frozen layer
I can substring the url but I can't find out the index of / signs correctly ...
const dec = "https://langfox.ir/expect/sources/frozen_2019/the_beautiful_forest_version_1/are you enjoying your new frozen layer/1614282551749614446037f2253780f2f.wav"
var mySubString = dec.substring(
dec.lastIndexOf("/") - X, // X is something I can't find out
dec.lastIndexOf("/")
);
console.log(mySubString);
How can we do this?