Find and Change text in a variable or textfield


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



Copy this code and paste it in your HTML
  1. var textToInsert:String = "the brown fox jumped over the fence";
  2.  
  3. textToInsert = textToInsert.split("fence").join("river");
  4.  
  5.  
  6.  
  7.  
  8. the end result is:
  9. the brown fox jumped over the river.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.