Java String Decapitalize decapitalize(String name)

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

Description

Utility method to take a string and convert it to normal Java variable name capitalization.

License

Open Source License

Parameter

Parameter Description
name The string to be made in camel case.

Return

The camel case version of the string.

Declaration

public static String decapitalize(String name) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*w w  w .ja v a 2 s  . c  o  m*/
     * Utility method to take a string and convert it to normal Java variable name
     * capitalization.
     * 
     * @param name
     *          The string to be made in camel case.
     * @return The camel case version of the string.
     */
    public static String decapitalize(String name) {
        if (name == null || name.length() == 0) {
            return name;
        }
        int offset1 = Character.offsetByCodePoints(name, 0, 1);
        if (offset1 < name.length() && Character.isUpperCase(name.codePointAt(offset1)))
            return name;
        return name.substring(0, offset1).toLowerCase() + name.substring(offset1);
    }
}

Related

  1. decapitalize(String name)
  2. decapitalize(String name)
  3. decapitalize(String name)
  4. decapitalize(String name)
  5. decapitalize(String name)
  6. deCapitalize(String noun)
  7. decapitalize(String s)
  8. decapitalize(String s)
  9. decapitalize(String st)