Javascript String "replace" function only replace 1 instance of the string.
If you need a replaceAll function, here is a handy function:
function replaceAll(source, find, replace) {
if (source == null) { return source; }
var aString = source.split(find);
return aString.join(replace);
}
No comments:
Post a Comment