Here you can find the source of toLowerCase(String str)
Parameter | Description |
---|---|
str | a parameter |
public static String toLowerCase(String str)
//package com.java2s; //License from project: LGPL public class Main { /**/*from ww w .j a v a 2s . c o m*/ * cast a string a lower case String, is faster than the String.toLowerCase, if all Character are already Low Case * @param str * @return lower case value */ public static String toLowerCase(String str) { int len = str.length(); char c; for (int i = 0; i < len; i++) { c = str.charAt(i); if (!((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'))) { return str.toLowerCase(); } } return str; } public static int length(String str) { if (str == null) return 0; return str.length(); } }