harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lian...@apache.org
Subject svn commit: r501768 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.java
Date Wed, 31 Jan 2007 08:42:51 GMT
Author: liangyx
Date: Wed Jan 31 00:42:50 2007
New Revision: 501768

URL: http://svn.apache.org/viewvc?view=rev&rev=501768
Log:
Apply patch for HARMONY-3082( [classlib][luni]add new methods toASCIILowerCase and toASCIIUpperCase
to org.apache.harmony.luni.Util for internal use)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.java?view=diff&rev=501768&r1=501767&r2=501768
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/Util.java
Wed Jan 31 00:42:50 2007
@@ -267,4 +267,30 @@
 		}
 		return result.toString();
 	}
+	
+	public static String toASCIILowerCase(String s) {
+		StringBuffer buffer = new StringBuffer();
+		for (int i = 0; i < s.length(); i++) {
+			char c = s.charAt(i);
+			if ('A' <= c && c <= 'Z') {
+				buffer.append((char) (c + ('a' - 'A')));
+			} else {
+				buffer.append(c);
+			}
+		}
+		return buffer.toString();
+	}
+	
+	public static String toASCIIUpperCase(String s) {
+		StringBuffer buffer = new StringBuffer();
+		for (int i = 0; i < s.length(); i++) {
+			char c = s.charAt(i);
+	        if ('a' <= c && c <= 'z') {
+	        	buffer.append((char) (c - ('a' - 'A')));
+	        } else {
+				buffer.append(c);
+			}
+		}
+		return buffer.toString();
+	}
 }



Mime
View raw message