replacing words within strings


/ Published in: ActionScript 3
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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

You need to login to post a comment.