Just a small function to replace text in a string, handy for things at times…
//String Replace Class
function stringReplace(block:String, find:String, replace:String):String
{
return block.split(find).join(replace);
}
myString = "I love actionscript";
output = stringReplace(myString, "love", "hate");
trace("NewString = " + output);
No comments:
Post a Comment