Return to Snippet

Revision: 201
at July 4, 2006 13:00 by drukepple


Initial Code
myString.split("foo").join("bar");

Initial URL


Initial Description
Provides a quick and simple "find this string pattern and replace it with this other string pattern" find and replace.  Not fancy enough for regular expressions, but untill AS3 is standard this works well for most search/replace needs.

Can be very handy for processing incoming text, whether via user input or from a database or otherwise.  For instance, searching for "\r" and replacing with "\n" or "" to control how line breaks flow.

Initial Title
String Search and Replace

Initial Tags
actionscript

Initial Language
ActionScript