Remove Carriage Returns and New Lines (AS3)

[code]
function removeCarriageReturnsAndNewLines($myString:String):String
{
var newString:String;
var findCarriageReturnRegExp:RegExp = new RegExp(“r”, “gi”);
newString = $myString.replace(findCarriageReturnRegExp, “”);
var findNewLineRegExp:RegExp = new RegExp(“n”, “gi”);
newString = newString.replace(findNewLineRegExp, “”);
return newString;
}
[/code]

Remove Carriage Returns and New Lines (AS3)