If I have a snippet of javascript code like this:
var str = "This is a snippet;
str.replace(/ */gi,' ');
what should the call to replace do? My actual tests show that it inserts
spaces between each letter... but this doesn't make sense to me. From the
regex, it looks like it should be replacing any occurrence of a space
followed by any character with a space, meaning that we should have
something like 'This s nippet'.
Please help me clarify this.
TIA,
--
Akin
aknak at aksoto dot idps dot co dot uk