[as3]

var rex:RegExp = /[\s\r\n]+/gim;
var str:String = "This is a string.";

str = str.replace(rex,”);
// str is now "Thisisastring."

[/as3]

For trimming front and back of strings, use
[as3]

var rex:RegExp /^\s*|\s*$/gim;

[/as3]

Leave a Reply

Your email address will not be published. Required fields are marked *

Post Navigation