Here you can find the source of toLowerCase(final String s)
public static String toLowerCase(final String s)
//package com.java2s; //License from project: Open Source License public class Main { public static String toLowerCase(final String s) { return hasUpperLetter(s) ? s.toLowerCase() : s; }//from w w w . ja v a 2 s . co m public static boolean hasUpperLetter(final CharSequence s) { int len; if (null != s && (len = s.length()) != 0) while (len > 0) if (Character.isUpperCase(s.charAt(--len))) return true; return false; } }