I have a variable in javascript with text separated with commas, for example:
var array = "hello,goodbye,test1,test2,1,90m tall"; [NO SPACE AFTER COMMAS]
If I use .split(','); the result is as follows:
array[0] = hello
array[1] = goodbye
array[2] = test1
array[3] = test2
array[4] = 1
array[5] = 90m tall
But I want this:
array[0] = hello
array[1] = goodbye
array[2] = test1
array[3] = test2
array[4] = 1,90m tall
How can I do it? I can imagine I have to add some special restriction but I don't know how...I also checked regex but...no success.
.,answers, but only if you can guarantee that's how the commas are separated.