Here you can find the source of toLowerCase(char ch)
Parameter | Description |
---|---|
ch | The character to lower-case (if it is a US-ASCII upper-case character). |
public static final char toLowerCase(char ch)
//package com.java2s; /*//from w w w . j a v a2 s . c o m * 08/06/2004 * * RSyntaxUtilities.java - Utility methods used by RSyntaxTextArea and its * views. * * This library is distributed under a modified BSD license. See the included * RSyntaxTextArea.License.txt file for details. */ public class Main { /** * If the character is an upper-case US-ASCII letter, it returns the * lower-case version of that letter; otherwise, it just returns the * character. * * @param ch The character to lower-case (if it is a US-ASCII upper-case * character). * @return The lower-case version of the character. */ public static final char toLowerCase(char ch) { // We can logical OR with 32 because A-Z are 65-90 in the ASCII table // and none of them have the 6th bit (32) set, and a-z are 97-122 in // the ASCII table, which is 32 over from A-Z. // We do it this way as we'd need to do two conditions anyway (first // to check that ch<255 so it can index into our table, then whether // that table position has the upper-case mask). if (ch >= 'A' && ch <= 'Z') return (char) (ch | 0x20); return ch; } }