Posted By

drukepple on 07/04/06


Tagged

actionscript String utilitiy


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

Roshambo
andrewrench
tspitzr
shuchii


String Search and Replace


 / Published in: ActionScript
 

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.

  1. myString.split("foo").join("bar");

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Roshambo on July 26, 2006

If I'm correct, this works in JavaScript too.

You need to login to post a comment.