/**/ /*过滤空格函数*/ public function LTrim(s : String):String { var i : Number = 0; while(s.charCodeAt(i) == 32 || s.charCodeAt(i) == 13 || s.charCodeAt(i) == 10 || s.charCodeAt(i) == 9) { i++; } return s.substring(i,s.length);} public function RTrim(s : String):String { var i : Number = s.length - 1; while(s.charCodeAt(i) == 32 || s.charCodeAt(i) == 13 || s.charCodeAt(i) == 10 ||s.charCodeAt(i) == 9) { i--; } return s.substring(0,i+1);} public function Trim(s : String):String { return LTrim(RTrim(s)); } 转载于:https://www.cnblogs.com/fishert/archive/2007/03/02/661231.html