Posted By

cessnajumpin on 07/30/10


words replace strings

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


replacing words within strings

 / Published in: ActionScript 3

All credit for this goes to I'm just copying it here so I won't have to remember where I found it

  1. var theContent:String = “I hate when content has words like, ‘damn’ in it”
  2. theContent = theContent.split(“damn”).join(“darn”);
  3. trace(theContent); // outputs: I hate when content has words like, ‘darn’ in it

Report this snippet  


RSS Icon Subscribe to comments
Posted By: GeminiBillyBob on October 12, 2010

Why not to use replace method? theContent.replace("damn", "darn");

You need to login to post a comment.