Java Utililty Methods String Capitalize

List of utility methods to do String Capitalize

Description

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

Method

Stringcapitalize(String text)
Capitalizes the first letter of the given string.
String h = text.substring(0, 1).toUpperCase();
String t = text.substring(1);
return h + t;
Stringcapitalize(String text)
capitalize
if (text == null) {
    return null;
int length = text.length();
if (length == 0) {
    return text;
String answer = text.substring(0, 1).toUpperCase();
...
Stringcapitalize(String text)
capitalize
if (text == null)
    return null;
if (text.length() == 1)
    return text.toUpperCase();
String s = "";
for (int i = 0; i < text.length(); i++)
    if (i - 1 < 0 || text.charAt(i - 1) == ' ')
        s += ("" + text.charAt(i)).toUpperCase();
...
Stringcapitalize(String texte)
Retourne une chaine de caracteres commencant par une lettre majuscule.
return texte.substring(0, 1).toUpperCase() + texte.substring(1);
Stringcapitalize(String to_capitalize)
This method capitalizes the first letter of the given String.
if (to_capitalize == null || to_capitalize.equals(""))
    return to_capitalize;
else if (to_capitalize.length() == 1)
    return to_capitalize.toUpperCase();
else
    return to_capitalize.substring(0, 1).toUpperCase() + to_capitalize.substring(1);
Stringcapitalize(String token)
capitalize
if (token.length() == 0)
    return "";
char cap = Character.toUpperCase(token.charAt(0));
if (token.length() == 1)
    return Character.toString(cap);
return cap + token.substring(1);
StringCapitalize(String val)
Capitalize
String returnVal = "";
if (val.length() > 0)
    returnVal = val.substring(0, 1).toUpperCase() + val.substring(1, val.length());
return returnVal;
Stringcapitalize(String value)
capitalize
int length = value.length();
StringBuilder s = new StringBuilder(length);
for (int i = 0; i < length; i++) {
    char c = value.charAt(i);
    if (i == 0) {
        c = Character.toUpperCase(c);
    } else {
        c = Character.toLowerCase(c);
...
Stringcapitalize(String value)
capitalize
return Character.toUpperCase(value.charAt(0)) + value.substring(1);
Stringcapitalize(String value)
capitalize
String capitalized = "";
if (isEmpty(value)) {
    return "";
value = value.toLowerCase();
capitalized = value.substring(0, 1).toUpperCase();
if (1 < value.length()) {
    capitalized += value.substring(1);
...