Actionscript string replace

Actionscript string replace


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 strreplace.as

function str_replace(haystack, needle, replacement) {
	temp = haystack.split(needle);
	return temp.join(replacement);
}