I have a function that works great in Actionscript 2, except it can only replace one character. I need it to behave more like str_replace in PHP and replace an array of characters.
Here is the code I have now, it simply replaces a space ( ) with a hyphen (-) in a String.
function str_replace(str){
return str.split(" ").join("-");
}
What I am trying to do is replace spaces, commas, and combinations of characters (ex. space and comma) from Actionscript strings for use in URLs.
So this:
Shop, Dine, Play
Will become this:
Shop-Dine-Play
Any suggestions are greatly appreciated! :)