views:

47

answers:

1

Hey all, I've got the following regex:

var outstring = inputsplit.join(';').replace(/\s/g, '');

the problem is, given the array:

["this ", "is ", "a ", "test"]

the output is

"this;is ;a ;test"

instead of

"this;is;a;test"

any pointers on what I can do to get this global filter to work?

+2  A: 

There shouldn't be a problem with this - that exact code gives the correct result for me..?

What browser are you using? I can't imagine there would be a difference between them on something as basic as regexp though.

Nick