PDA

View Full Version : how to use this search-replace code...


annoying n00b
08-12-2003, 05:24 AM
found thisString.prototype.searchReplace=function(find,r eplace) {
var result = this.split(find);
return result.join(replace);
}but don't know how to use it

let's say the variable string is "content.htmlText" and i want to replace the 12's with 3's ... how do i do this?

Billy T
08-12-2003, 05:38 AM
well I havent used it but at a guess

myString=content.htmlText;
myString=myString.searchReplace("12","3");

see how that goes

cheers