Posted By

Bonky on 07/12/07


search replace array String text join split

Versions (?)

Search and replace text in a string

 / Published in: ActionScript

  1. var newText:String = "The rain in Spain falls mainly on the plain";
  2. var splitText:Array = newText.split("Spain");
  3. newText = splitText.join("Barcelona");
  4. // outputs "The rain in Barcelona falls mainly on the plain"

Report this snippet  

You need to login to post a comment.