Search and replace is a very useful thing to have. Actionscript dosent have a built-in function for this purpose. This is very simple function which can do the above thing.
Source code for webtoolkit.strreplace.as
1
2
3
4
5
6
7
8
9
10
11
|
/**
*
* Actionscript string replace
* http://www.webtoolkit.info/
*
**/
function str_replace(haystack, needle, replacement) {
temp = haystack.split(needle);
return temp.join(replacement);
}
|