Java String Uncapitalize uncapitalize(String string)

Here you can find the source of uncapitalize(String string)

Description

Returns the specified string with its first character converted to lower case.

License

Open Source License

Parameter

Parameter Description
string the String to be processed

Return

the specified string with its first character converted to lower case

Declaration

public static String uncapitalize(String string) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*  ww  w .  ja  va2s .c  om*/
     * Returns the specified string with its first character converted to
     * lower case.
     * 
     * @param string the String to be processed
     * @return the specified string with its first character converted to
     * lower case
     */
    public static String uncapitalize(String string) {
        int length = string.length();
        if (length == 0) {
            return string;
        } else if (length == 1) {
            return string.toLowerCase();
        } else {
            return (Character.toLowerCase(string.charAt(0)) + string.substring(1));
        }
    }
}

Related

  1. uncapitalize(String str)
  2. unCapitalize(String str)
  3. uncapitalize(String str)
  4. uncapitalize(String str)
  5. uncapitalize(String str)
  6. unCapitalize(String string)
  7. uncapitalize(String string)
  8. uncapitalize(String string)
  9. uncapitalize(String string0)