If I have a string… abcdefghi
and I want to use regex to load every elemnent into an array but I want to be able to stick anything connected by plus sign into the same element… how to do that?
var mystring = "abc+d+efghi"
output array ["a","b","cde","f","g","h","i"]
One way to do it:
The value of
a[3]should now be ‘def’.http://jsfiddle.net/rbFwR/2