flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Make StringUtil not extend StringTrimmer, and delegate relevant methods instead.
Date Sun, 10 Jul 2016 10:27:56 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop a7368afd1 -> b8bf17763


Make StringUtil not extend StringTrimmer, and delegate relevant methods instead.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b8bf1776
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b8bf1776
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b8bf1776

Branch: refs/heads/develop
Commit: b8bf177636594010164556b3251dfe6cb683186b
Parents: a7368af
Author: yishayw <yishayjobs@hotmail.com>
Authored: Sun Jul 10 13:27:14 2016 +0300
Committer: yishayw <yishayjobs@hotmail.com>
Committed: Sun Jul 10 13:27:14 2016 +0300

----------------------------------------------------------------------
 .../flex/org/apache/flex/utils/StringUtil.as    | 82 +++++++++++++++++++-
 1 file changed, 81 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b8bf1776/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/StringUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/StringUtil.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/StringUtil.as
index 6c7007f..8674180 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/StringUtil.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/StringUtil.as
@@ -31,7 +31,7 @@ package org.apache.flex.utils
 	 *  @productversion Flex 3
 	 *  @productversion FlexJS 0.0
 	 */
-	public class StringUtil extends StringTrimmer
+	public class StringUtil
 	{
 		public function StringUtil()
 		{
@@ -180,6 +180,86 @@ package org.apache.flex.utils
 			return String.fromCharCode.apply(null, charCodes);
 		}
 		
+        /**
+         *  Removes all whitespace characters from the beginning and end
+         *  of the specified string.
+         *
+         *  @param str The String whose whitespace should be trimmed. 
+         *
+         *  @return Updated String where whitespace was removed from the 
+         *  beginning and end. 
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static function trim(str:String):String
+        {
+            return StringTrimmer.trim(str);
+        }
+        
+        /**
+         *  Removes all whitespace characters from the beginning and end
+         *  of each element in an Array, where the Array is stored as a String. 
+         *
+         *  @param value The String whose whitespace should be trimmed. 
+         *
+         *  @param separator The String that delimits each Array element in the string.
+         *
+         *  @return Array where whitespace was removed from the 
+         *  beginning and end of each element. 
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static function splitAndTrim(value:String, delimiter:String):Array
+        {
+            return StringTrimmer.splitAndTrim(value,delimiter);
+        }
+        
+        /**
+         *  Removes all whitespace characters from the beginning and end
+         *  of each element in an Array, where the Array is stored as a String. 
+         *
+         *  @param value The String whose whitespace should be trimmed. 
+         *
+         *  @param separator The String that delimits each Array element in the string.
+         *
+         *  @return Updated String where whitespace was removed from the 
+         *  beginning and end of each element. 
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static function trimArrayElements(value:String, delimiter:String):String
+        {
+            return StringTrimmer.trimArrayElements(value,delimiter);
+        }
+        
+        /**
+         *  Returns <code>true</code> if the specified string is
+         *  a single space, tab, carriage return, newline, or formfeed character.
+         *
+         *  @param str The String that is is being queried. 
+         *
+         *  @return <code>true</code> if the specified string is
+         *  a single space, tab, carriage return, newline, or formfeed character.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static function isWhitespace(character:String):Boolean
+        {
+            return StringTrimmer.isWhitespace(character);
+        }
+
 		/**
 		 *  @private
 		 *  Helper method used by restrict() to test each character


Mime
View raw message