There is a function String.replace() which returns the result string. But note, this only replaces the first occurance of given string/expression!
So, to actually replace all the occurances of given string/expression, you must loop through until all the matches are replaced. Code & Documentation
However, there is another easy customized function to automatically replace all the occurance of given match. Here goes the customized function:
var myStr:String = str_replace("a_b_c", "_" , "1"); // a1b1c1
Got Help From Source