Tuesday, 02 August 2005
what is also unusual for c# programmers is that the pattern you pass into the function does not get wrapped in quotes.
example: to replace all single-quotes in a string variable (called s) with the ` character:
s = s.replace(/'/gi, '`');
if that looks like gobbledegook i'll explain. the first / character starts the pattern, and the ' character is what we want to replace. the second / character ends the pattern and allows us to include options for the regex parser. g means global and i means ignore case.
i'm really only posting this so i'll remember it myself!
Tuesday, 02 August 2005 13:43:45 (GMT Daylight Time, UTC+01:00) General