We split the string using split before the string we want to delete. As parameter we enter the string to delete. Then we join the remaining string.


import mx.controls.TextArea;
var urlstring:String = "I have a string and now remove I have a new string.";
var removeString:String = "remove ";
var before:TextArea;
var after:TextArea;
function splitString(url:String, removeString:String) {
	before.text = url;
	var splitted:Array = url.split(removeString);
	var joined:String = splitted.join("");
	after.text = joined;
}
splitString(urlstring, removeString);