Archive for October 30th, 2008
Removing whitespace characters from String
var str:String=” 123456789 “;
Trace(str.length); //15
Trace(StringUtil.trim(str).length); //9
StringUtil.trim method removes all whitespace characters from the beginning and end of the specified string.
The StringUtil utility class has some more methods that will be more useful when you work with String objects within Flex:-)