diff --git a/Software Development Kit (SDK)/Flash Professional/Flash Player v10.0/src/com/adobe/coreUI/util/StringUtils.as b/Software Development Kit (SDK)/Flash Professional/Flash Player v10.0/src/com/adobe/coreUI/util/StringUtils.as index c49e992..81d83ff 100644 --- a/Software Development Kit (SDK)/Flash Professional/Flash Player v10.0/src/com/adobe/coreUI/util/StringUtils.as +++ b/Software Development Kit (SDK)/Flash Professional/Flash Player v10.0/src/com/adobe/coreUI/util/StringUtils.as @@ -84,9 +84,8 @@ package com.adobe.coreUI.util public static function trim(str:String):String { - for(var i:int = 0; str.charCodeAt(i) < 33; i++); - for(var j:int = str.length-1; str.charCodeAt(j) < 33; j--); - return str.substring(i, j+1); + if ( str == null ) return null; + return str.replace( /^\s*/, '' ).replace( /\s*$/, '' ); } } -} \ No newline at end of file +} diff --git a/Software Development Kit (SDK)/Flash Professional/Flash Player v10.1/src/com/adobe/coreUI/util/StringUtils.as b/Software Development Kit (SDK)/Flash Professional/Flash Player v10.1/src/com/adobe/coreUI/util/StringUtils.as index c49e992..81d83ff 100644 --- a/Software Development Kit (SDK)/Flash Professional/Flash Player v10.1/src/com/adobe/coreUI/util/StringUtils.as +++ b/Software Development Kit (SDK)/Flash Professional/Flash Player v10.1/src/com/adobe/coreUI/util/StringUtils.as @@ -84,9 +84,8 @@ package com.adobe.coreUI.util public static function trim(str:String):String { - for(var i:int = 0; str.charCodeAt(i) < 33; i++); - for(var j:int = str.length-1; str.charCodeAt(j) < 33; j--); - return str.substring(i, j+1); + if ( str == null ) return null; + return str.replace( /^\s*/, '' ).replace( /\s*$/, '' ); } } -} \ No newline at end of file +} diff --git a/Software Development Kit (SDK)/Flash Professional/Flash Player v10.3/src/com/adobe/coreUI/util/StringUtils.as b/Software Development Kit (SDK)/Flash Professional/Flash Player v10.3/src/com/adobe/coreUI/util/StringUtils.as index c49e992..81d83ff 100644 --- a/Software Development Kit (SDK)/Flash Professional/Flash Player v10.3/src/com/adobe/coreUI/util/StringUtils.as +++ b/Software Development Kit (SDK)/Flash Professional/Flash Player v10.3/src/com/adobe/coreUI/util/StringUtils.as @@ -84,9 +84,8 @@ package com.adobe.coreUI.util public static function trim(str:String):String { - for(var i:int = 0; str.charCodeAt(i) < 33; i++); - for(var j:int = str.length-1; str.charCodeAt(j) < 33; j--); - return str.substring(i, j+1); + if ( str == null ) return null; + return str.replace( /^\s*/, '' ).replace( /\s*$/, '' ); } } -} \ No newline at end of file +} diff --git a/Software Development Kit (SDK)/Flash Professional/Flash Player v9.0/src/com/adobe/coreUI/util/StringUtils.as b/Software Development Kit (SDK)/Flash Professional/Flash Player v9.0/src/com/adobe/coreUI/util/StringUtils.as index c49e992..81d83ff 100644 --- a/Software Development Kit (SDK)/Flash Professional/Flash Player v9.0/src/com/adobe/coreUI/util/StringUtils.as +++ b/Software Development Kit (SDK)/Flash Professional/Flash Player v9.0/src/com/adobe/coreUI/util/StringUtils.as @@ -84,9 +84,8 @@ package com.adobe.coreUI.util public static function trim(str:String):String { - for(var i:int = 0; str.charCodeAt(i) < 33; i++); - for(var j:int = str.length-1; str.charCodeAt(j) < 33; j--); - return str.substring(i, j+1); + if ( str == null ) return null; + return str.replace( /^\s*/, '' ).replace( /\s*$/, '' ); } } -} \ No newline at end of file +}