splitting by spaces:
I got the following code:
var test=" v2 v3 v4 v1 ";
basicly the 1st replace remove spaces on eeach side of the string
2nd replace takes groups spaces inside the string an replace with 1 space.
the split make an array splitting the string by space.
my question is are there a better regexp that can achieve the same goal on 1 line that I use 3 lines to.