var newText:String = "The rain in Spain falls mainly on the plain";
var splitText:Array = newText.split("Spain");
newText = splitText.join("Barcelona");
// outputs "The rain in Barcelona falls mainly on the plain"
Search and replace text in a string
Leave a Reply
You must be logged in to post a comment.