dschmierer
04-19-2007, 02:53 AM
Hi,
I'm writing a script that requires splitting a string by ' ' spaces but it seems to fail when there's a : (colon) in the string. For example,
var string1 = "blah result1";
var string2 = "blah result:2";
var string3 = "blah result-3";
string1.split(' ')[1]; //produces result1
string2.split(' ')[1]; //produces undefined
string3.split(' ')[1]; //produces result-3
the split doesn't work for me when there's a : in the string, any ideas what is happening? thanks,
Dave
I'm writing a script that requires splitting a string by ' ' spaces but it seems to fail when there's a : (colon) in the string. For example,
var string1 = "blah result1";
var string2 = "blah result:2";
var string3 = "blah result-3";
string1.split(' ')[1]; //produces result1
string2.split(' ')[1]; //produces undefined
string3.split(' ')[1]; //produces result-3
the split doesn't work for me when there's a : in the string, any ideas what is happening? thanks,
Dave