Java String Decapitalize decapitalizeFirstLetter(final String str)

Here you can find the source of decapitalizeFirstLetter(final String str)

Description

Utility method decapitalizes the first letter of string, used to generate variable names from type name

License

Open Source License

Parameter

Parameter Description
str string for decapitalization.

Return

string with the first letter decapitalized.

Declaration

public static String decapitalizeFirstLetter(final String str) 

Method Source Code

//package com.java2s;
/*//from   w w  w. j  a  va2s. co  m
 * Copyright 2001-2008 Aqris Software AS. All rights reserved.
 * 
 * This program is dual-licensed under both the Common Development
 * and Distribution License ("CDDL") and the GNU General Public
 * License ("GPL"). You may elect to use one or the other of these
 * licenses.
 */

public class Main {
    /** Utility method decapitalizes the first letter of string, used to
     * generate variable names from type name
     * @param str string for decapitalization.
     * @return string with the first letter decapitalized.
     */
    public static String decapitalizeFirstLetter(final String str) {
        if (str == null || str.length() <= 0) {
            return str;
        }

        final char[] chars = str.toCharArray();
        chars[0] = Character.toLowerCase(chars[0]);
        return new String(chars);
    }
}

Related

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