Here you can find the source of toLowerCase(String str)
public static String toLowerCase(String str)
//package com.java2s; /*/*from w w w . j a va 2 s .c o m*/ * JBoss, Home of Professional Open Source. * * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing. * * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. */ public class Main { public static String toLowerCase(String str) { String newStr = convertBasicLatinToLower(str); if (newStr == null) { return str.toLowerCase(); } return newStr; } private static String convertBasicLatinToLower(String str) { char[] chars = str.toCharArray(); for (int i = 0; i < chars.length; i++) { if (isBasicLatinUpperCase(chars[i])) { chars[i] = (char) ('a' + (chars[i] - 'A')); } else if (!isBasicLatinChar(chars[i])) { return null; } } return new String(chars); } private static boolean isBasicLatinUpperCase(char c) { return c >= 'A' && c <= 'Z'; } private static boolean isBasicLatinChar(char c) { return c <= '\u007F'; } }