Java String Decapitalize decapitalize(String string)

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

Description

Return (possibly copy of) given string with first character lower case.

License

Open Source License

Declaration

public static String decapitalize(String string) 

Method Source Code

//package com.java2s;
/* Copyright (c) 2008 Charles Rich and Worcester Polytechnic Institute.
 * All Rights Reserved.  Use is subject to license terms.  See the file
 * "license.terms" for information on usage and redistribution of this
 * file and for a DISCLAIMER OF ALL WARRANTIES.
 *///www .j  a v  a  2  s .c o  m

public class Main {
    /**
     * Return (possibly copy of) given string with first character lower case.
     */
    public static String decapitalize(String string) {
        if (Character.isLowerCase(string.charAt(0)))
            return string;
        char chars[] = string.toCharArray();
        chars[0] = Character.toLowerCase(chars[0]);
        return new String(chars);
    }
}

Related

  1. decapitalize(String str)
  2. decapitalize(String string)
  3. decapitalize(String string)
  4. decapitalize(String string)
  5. decapitalize(String string)
  6. decapitalize(String text)
  7. decapitalize(String word)
  8. decapitalizeAsJavaBeans(String name)
  9. decapitalizeFirstCharOfString(final String input)