I have a string like this: "one/two/three/four" and I just want to return:
"one"
"two/three/four"
I'm not the greatest with regex expressions to split on, so was wondering if someone could help.
Just use String.prototype.split.
var components = "one/two/three/four".split("/");
console.log(components[0]);
console.log(components.slice(1).join("/"));
This will print:
one
two/three/four
1 was there. I've removed it.