Java Utililty Methods String Uncapitalize

List of utility methods to do String Uncapitalize

Description

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

Method

Stringuncapitalize(String name)
Returns the input string with the first letter in lower case.
if (name == null)
    return null;
if (name.length() == 0)
    return name;
if (name.length() == 1)
    return name.substring(0, 1).toLowerCase();
return name.substring(0, 1).toLowerCase() + name.substring(1);
Stringuncapitalize(String s)
uncapitalize
return s.isEmpty() ? "" : Character.toLowerCase(s.charAt(0)) + s.substring(1);
StringunCapitalize(String s)
un Capitalize
if (s == null)
    return null;
if (s.isEmpty())
    return s;
if (s.length() == 1)
    return s.toLowerCase();
return s.substring(0, 1).toLowerCase() + s.substring(1);
Stringuncapitalize(String s)
uncapitalize
if (s == null || s.isEmpty())
    return s;
char[] chars = s.toCharArray();
chars[0] = Character.toLowerCase(chars[0]);
return new String(chars);
Stringuncapitalize(String s)
uncapitalize
if (s == null) {
    return s;
int size = s.length();
if (size == 0) {
    return s;
StringBuilder builder = new StringBuilder(size);
...
Stringuncapitalize(String source)
Ensure that the first character of the provided string lower case.
if (source == null || source.length() == 0) {
    return source;
if (source.length() > 1 && Character.isLowerCase(source.charAt(0))) {
    return source;
char chars[] = source.toCharArray();
chars[0] = Character.toLowerCase(chars[0]);
...
StringunCapitalize(String str)
un Capitalize
int strLen = str != null ? str.length() : 0;
if (strLen == 0)
    return str;
if (strLen > 1 && Character.isUpperCase(str.charAt(0)) && Character.isUpperCase(str.charAt(1))) {
    return str;
} else {
    return new StringBuffer(strLen).append(Character.toLowerCase(str.charAt(0))).append(str.substring(1))
            .toString();
...
Stringuncapitalize(String str)

Uncapitalizes all the whitespace separated words in a String.

int strLen;
if (str == null || (strLen = str.length()) == 0) {
    return str;
StringBuffer buffer = new StringBuffer(strLen);
boolean whitespace = true;
for (int i = 0; i < strLen; i++) {
    char ch = str.charAt(i);
...
Stringuncapitalize(String str)
uncapitalize
int strLen;
if ((str == null) || ((strLen = str.length()) == 0)) {
    return str;
return new StringBuffer(strLen).append(Character.toLowerCase(str.charAt(0))).append(str.substring(1))
        .toString();
Stringuncapitalize(String str)
uncapitalize
return uncapitalize(str, null);