Java String Lower Case toLowercaseFirstLetter(String str)

Here you can find the source of toLowercaseFirstLetter(String str)

Description

to Lowercase First Letter

License

Open Source License

Declaration

public static String toLowercaseFirstLetter(String str) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String toLowercaseFirstLetter(String str) {
        if (str == null || str.length() == 0) {
            return str;
        }//  w w  w  . j  ava  2s . co  m

        char firstLetter = str.charAt(0);
        if (Character.isUpperCase(firstLetter)) {

            if (str.length() > 1) {
                return "" + Character.toLowerCase(firstLetter) + str.substring(1);
            } else {
                return "" + Character.toLowerCase(firstLetter);
            }

        } else {
            return str;
        }
    }
}

Related

  1. toLowerCaseFirst(String str)
  2. toLowerCaseFirst(String str)
  3. toLowerCaseFirst(String text)
  4. toLowerCaseFirst(String text)
  5. toLowerCaseFirstLetter(String str)
  6. toLowercaseFirstLetter(String value)
  7. toLowerCaseFirstOne(String s)
  8. toLowerCaseIdent(String ident)
  9. toLowerCaseIgnoreNull(String tobeDone)