Here you can find the source of decapitalizeString(String string)
string
decapitalized (the first letter in lowercase).
Parameter | Description |
---|---|
string | the string to decapitalize |
public static String decapitalizeString(String string)
//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; } }