Java Utililty Methods String Proper Case

List of utility methods to do String Proper Case

Description

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

Method

StringtoProperCase(final String s)
Convert to "Proper case" ; capital first letter, lowercase suffix.
return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
StringtoProperCase(final String string)
to Proper Case
String lowerCase = string.toLowerCase();
lowerCase = lowerCase.substring(1);
String firstCharacter = "" + string.charAt(0);
firstCharacter = firstCharacter.toUpperCase();
return firstCharacter + lowerCase;
StringtoProperCase(String s)
to Proper Case
return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
StringtoProperCase(String s)
Convert the String s to proper case.
StringBuilder sb = new StringBuilder();
for (String f : s.split(" ")) {
    if (sb.length() > 0) {
        sb.append(" ");
    sb.append(f.substring(0, 1).toUpperCase()).append(f.substring(1, f.length()).toLowerCase());
return sb.toString();
...
StringtoProperCase(String s)
To proper case.
return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
StringtoProperCase(String s)
to Proper Case
if (s.length() == 0) {
    return s;
} else if (s.length() == 1) {
    return s.toUpperCase();
if (s.substring(1).equals(s.substring(1).toUpperCase())) {
    return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
} else {
...
StringtoProperCase(String text)
to Proper Case
text = text.toLowerCase();
if (text.length() > 1) {
    text = text.substring(0, 1).toUpperCase() + text.substring(1).toLowerCase();
} else {
    text = text.toUpperCase();
return text;
StringtoProperCase(String text)
to Proper Case
if ((text == null) || (text.length() == 0))
    return text;
else if (text.length() == 1)
    return text.toUpperCase();
else
    return new StringBuilder().append(text.substring(0, 1).toUpperCase()).append(text.substring(1))
            .toString();