Posted By

cessnajumpin on 07/30/10


Tagged

words replace strings


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

socialflasher


replacing words within strings


 / Published in: ActionScript 3
 

All credit for this goes to iheartactionscript.com 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  

Comments

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.