T
Tim Streater
I have this:
splitter = /[ -\/.]/;
dateItems = dateString.split (splitter, 3);
where dateString might contain such as 3.4.5 or 3/4/5 or 3-4-5.
But it might also be nullstring or any junk the user types in. Now I
find that with the code above, and a null string, .split gives up and I
get a JavaScript error, instead of what I might expect which would be
that the dateItems array contains one item, itself a null string.
Is there something better to use/do in this context? It's completely
stupid to have to parse the string once to check it will not kill
..split, and then do the same again to extract the values I want.
(I get the error with Safari 1.3.1 and Netscape under XP).
Thanks,
-- tim
splitter = /[ -\/.]/;
dateItems = dateString.split (splitter, 3);
where dateString might contain such as 3.4.5 or 3/4/5 or 3-4-5.
But it might also be nullstring or any junk the user types in. Now I
find that with the code above, and a null string, .split gives up and I
get a JavaScript error, instead of what I might expect which would be
that the dateItems array contains one item, itself a null string.
Is there something better to use/do in this context? It's completely
stupid to have to parse the string once to check it will not kill
..split, and then do the same again to extract the values I want.
(I get the error with Safari 1.3.1 and Netscape under XP).
Thanks,
-- tim