Java String Decapitalize decapitalizeString(String string)

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

Description

Returns the string defined by parameter string decapitalized (the first letter in lowercase).

License

Open Source License

Parameter

Parameter Description
string the string to decapitalize

Return

a decapitalized string (the first letter in lowercase)

Declaration

public static String decapitalizeString(String string) 

Method Source Code

//package com.java2s;
/* IBS Copyright/Security Notice ***************************************
 *                                              
 *  BAP Property of IBS AB// www  .j a v a 2  s . co  m
 *  (C) Copyright IBS AB 2001-2003
 *  All rights reserved.                        
 *  Use, duplication, or disclosure restricted  
 *  by license agreement with IBS AB.           
 *                                              
 *  Licensed Materials - Property of IBS AB     
 *                                              
 * End IBS Copyright/Security Notice **********************************
 *
 *
 * User  Date          Comment     
 * ---------------------------------------------------------------------
 * DMA   01/01/2000    Class created
 *  
 ***********************************************************************/

public class Main {
    /**
     * Returns the string defined by parameter <code>string</code> 
     * decapitalized (the first letter in lowercase). 
     *
     * @param    string    the string to decapitalize
     * @return             a decapitalized string (the first letter 
     *                     in lowercase)
     */
    public static String decapitalizeString(String string) {
        if (string.length() == 0)
            return string;

        String firstLetter = string.substring(0, 1);
        String theRest = string.substring(1, string.length());
        return firstLetter.toLowerCase() + theRest;

    }
}

Related

  1. decapitalizeFirstCharOfString(final String input)
  2. decapitalizeFirstLetter(final String str)
  3. deCapitalizeFirstLetter(String data)
  4. decapitalizeName(String name)
  5. decapitalizePropertyName(String propertyName)
  6. decapitalizeTheFirstLetter(String input)