Java Utililty Methods String Decapitalize

List of utility methods to do String Decapitalize

Description

The list of methods to do String Decapitalize are organized into topic(s).

Method

Stringdecapitalize(final String s)
decapitalize
if (s == null)
    return "";
return s.substring(0, 1).toLowerCase() + s.substring(1);
Stringdecapitalize(final String string)
decapitalize
return Character.toLowerCase(string.charAt(0)) + string.substring(1);
Stringdecapitalize(final String value)
decapitalize
String result = "";
boolean capitalize = false, isFirstLetter = true;
for (final char c : value.toCharArray()) {
    final boolean isLetter = Character.isLetter(c);
    if (isLetter) {
        result += (!isFirstLetter && (capitalize || Character.isUpperCase(c))) ? Character.toUpperCase(c)
                : Character.toLowerCase(c);
        if (isFirstLetter) {
...
Stringdecapitalize(String name)
decapitalize
if (name == null || name.length() == 0) {
    return name;
if (name.length() > 1 && Character.isUpperCase(name.charAt(1)) && Character.isUpperCase(name.charAt(0))) {
    return name;
char chars[] = name.toCharArray();
chars[0] = Character.toLowerCase(chars[0]);
...
Stringdecapitalize(String name)
Utility method to take a string and convert it to normal Java variable name capitalization.
if (name.length() == 0) {
    return name;
if (name.length() > 1 && Character.isUpperCase(name.charAt(1)) && Character.isUpperCase(name.charAt(0))) {
    return name;
char chars[] = name.toCharArray();
char c = chars[0];
...
Stringdecapitalize(String name)
Lowercases the first character of a string.
if (name != null && name.length() > 0) {
    char c = name.charAt(0);
    if (Character.isUpperCase(c)) {
        StringBuffer sb = new StringBuffer(name);
        sb.setCharAt(0, Character.toLowerCase(c));
        name = sb.toString();
return name;
Stringdecapitalize(String name)
decapitalize
return name.substring(0, 1).toLowerCase() + name.substring(1);
Stringdecapitalize(String name)
Utility method to take a string and convert it to normal Java variable name capitalization.
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);
Stringdecapitalize(String name)
decapitalize
if (name == null || name.isEmpty()) {
    return name;
if (Character.isUpperCase(name.charAt(0))) {
    char chars[] = name.toCharArray();
    chars[0] = Character.toLowerCase(chars[0]);
    return new String(chars);
} else {
...
StringdeCapitalize(String noun)
de Capitalize
if (noun == null || noun.trim().length() == 0) {
    return noun;
return Character.toLowerCase(noun.charAt(0)) + noun.substring(1);