0
Posted on 5:00 AM by Author and filed under ,
Today i came across the jptarry Blog and i found one intersting string replace function.



Split function splits at the given string and join method inserts and concats..



var str:String = strReplace("this is a test page to replace this from the sentence","this", "THIS");
trace(str)
function strReplace($str:String, $search:String, $replace:String):String {
return $str.split($search).join($replace);
}


//outputs as "THIS is a test page to replace THIS from the sentence"
0
Responses to ... Search and Replace String AS2/AS3: