View Single Post
Old 02-01-2013, 09:50 PM   PM User | #1
zep
New to the CF scene

 
Join Date: Dec 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
zep is an unknown quantity at this point
string split RegExp problem

Hi.

Iīd like to get an array from a split thatīd remove all whitespaces from words, and return me only the words. Example:

var string = " test1 test2 test3 test4 ";

So I would want a regexp on split thatīd remove all the whitespaces, and return only the words.

The array returned would be like this ["test1", "test2", "test3", "test4"].

Actually the string have more than one (various) white spaces between the words.
The Editor text of this forum cut them out.

Thanks.
zep is offline   Reply With Quote