Here you can find the source of toLowerCase(char c)
public static char toLowerCase(char c)
//package com.java2s; // Licensed under the Academic Free License version 3.0 public class Main { /**//from w w w.j a va 2s .c o m * Do an ASCII only lower case conversion. Case conversion * with Locale can result in unexpected side effects. */ public static char toLowerCase(char c) { if ('A' <= c && c <= 'Z') return (char) (c | 0x20); else return c; } /** * Do an ASCII only lower case conversion. Case conversion * with Locale can result in unexpected side effects. */ public static String toLowerCase(String s) { // first scan to see if string isn't already ok int len = s.length(); int first = -1; for (int i = 0; i < len; ++i) { char a = s.charAt(i); char b = toLowerCase(a); if (a != b) { first = i; break; } } if (first == -1) return s; // allocate new char buf and copy up to first change char[] buf = new char[len]; s.getChars(0, first, buf, 0); // change remainder of string for (int i = first; i < len; ++i) buf[i] = toLowerCase(s.charAt(i)); return new String(buf); } }