Welcome to my actionscript snippet library!

Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.  

Search And Replace Characters In String

Simple solution for replacing characters in a string

var str:String = "AS3 rocks!";
var search:String = "AS3";
var replace:String = "Actionscript 3";

function strReplace(str:String, search:String, replace:String):String {
return str.split(search).join(replace);
}

trace(strReplace(str, search, replace)); //Outputs Actionscript 3 rocks!

6 comments:

Elkin C said...

Muchas gracias por el codigo...

limpio para pasarlo al proyecto.

Nuevamente, muchas gracias.

shianky said...

Thank you very much! Saved me a lot of work.

Orien said...

Thank you man, nice way.

Unknown said...

Very useful. Thanks.

Lantechsoft said...

Very Nice Blog, Thanks for sharing such a nice blog. It is very simple to use while being compatible with all the popular versions of Windows find and replace in word

michaelwaung said...

Thanks for sharing this article with us ! This is so useful article. I hope keep sharing this type blog !
Best Search and Replace Software

Post a Comment