GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Java/strings/Lower.java at master · loisoft/Java Expand file tree/ Copy pathLower.javaMore file actions 28 lines (25 loc) · 761 Bytes / Copy pathLower.javaFile metadata and controls28 lines (25 loc) · 761 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 package strings; public class Lower { /** Driver Code */ public static void main(String[] args) { String[] strings = {"ABC", "ABC123", "abcABC", "abc123ABC"}; for (String s : strings) { assert toLowerCase(s).equals(s.toLowerCase()); } } /** * Converts all of the characters in this {@code String} to lower case * * @param s the string to convert * @return the {@code String}, converted to lowercase. */ public static String toLowerCase(String s) { char[] values = s.toCharArray(); for (int i = 0; i < values.length; ++i) { if (Character.isLetter(values[i]) && Character.isUpperCase(values[i])) { values[i] = Character.toLowerCase(values[i]); } } return new String(values); } } |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |