I am using split function to split my string /value/1
var value = "/value/1/";
var arr = value.split("/");
in result I will get an array with 4 elements "", "value", "1", ""; But I really need the nonempty values in the output array. Is there any way to produce an array base on my input string but array without blank elements?
My string could be /value/1/
/value/1
/value/
/value
basically I am precessing http request.url
.