Java String Decapitalize decapitalizeFirstCharOfString(final String input)

Here you can find the source of decapitalizeFirstCharOfString(final String input)

Description

Decapitalizes first char of an input string.

License

Open Source License

Parameter

Parameter Description
input the string to be processed;

Return

The input string with the first capitalized char. Returns empty string, if passed input String is null or empty.

Declaration

static String decapitalizeFirstCharOfString(final String input) 

Method Source Code

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

public class Main {
    /**//from  ww w .j a va  2  s.  c  o  m
     * Decapitalizes first char of an input string.
     *
     * @param input the string to be processed;
     * @return The input string with the first capitalized char. Returns empty string, if passed input String is null or empty.
     */
    static String decapitalizeFirstCharOfString(final String input) {
        if (input == null || input.length() == 0) {
            return "";
        } else if (input.length() == 1) {
            return input.toLowerCase();
        } else {
            return input.substring(0, 1).toLowerCase() + input.substring(1);
        }
    }
}

Related

  1. decapitalize(String string)
  2. decapitalize(String string)
  3. decapitalize(String text)
  4. decapitalize(String word)
  5. decapitalizeAsJavaBeans(String name)
  6. decapitalizeFirstLetter(final String str)
  7. deCapitalizeFirstLetter(String data)
  8. decapitalizeName(String name)
  9. decapitalizePropertyName(String propertyName)