String Search and Replace
String.prototype.replace = function(str, rep) {
return this.split(str).join(rep);
};
//use it like this
var myStr:String = "Hello earth!"
trace(myStr.replace("earth","world")
String.prototype.replace = function(str, rep) {
return this.split(str).join(rep);
};
//use it like this
var myStr:String = "Hello earth!"
trace(myStr.replace("earth","world")
Posted by Matt Maxwell at 6:02 AM
No comments:
Post a Comment