Flex中字符串trim方法
//去除左边空格public static function leftTrim(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 static function rightTrim(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 static function trim(s:String):String{return leftTrim(rightTrim(s)); }
?