Sunday, March 13, 2011

ReplaceAll in Javascript Example

ReplaceAll in Javascript Example:

Instead of:

mynicestring = mynicestring.replace("find","replacement");

Use:

mynicestring = mynicestring.replace(/find/g,"replacement");

No comments:

Post a Comment