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 content)
Capitalize first word of sentence
if (content.length() < 2) {
    return content;
String first = content.substring(0, 1).toUpperCase();
return first + content.substring(1);
Stringcapitalize(String data)
capitalize
StringBuffer sbuf = new StringBuffer(data.length());
sbuf.append(data.substring(0, 1).toUpperCase()).append(data.substring(1));
return sbuf.toString();
Objectcapitalize(String english)
capitalize
if (english.length() == 0)
    return "";
return Character.toString(Character.toUpperCase(english.charAt(0))) + english.substring(1);
Stringcapitalize(String in)
{ method
if (in.length() == 0)
    return ("");
StringBuffer s = new StringBuffer(in.length());
int i = 0;
char c = in.charAt(i++);
while (c <= ' ') {
    c = in.charAt(i++);
    if (i >= in.length())
...
Stringcapitalize(String in)
Capitalize the first letter of a text.
return capitalize(in, false);
Stringcapitalize(String in)
capitalize
String tail = in.substring(1);
String head = in.substring(0, 1);
return head.toUpperCase() + tail;
Stringcapitalize(String in)
capitalize
if (!"".equals(removeNull(in))) {
    String first = in.substring(0, 1).toUpperCase();
    return first + in.substring(1).toLowerCase();
return null;
Stringcapitalize(String input)
Capitalizes first character in given string
if (input == null) {
    return null;
if (input.length() > 1) {
    for (int i = 0; i < input.length(); i++) {
        if (Character.isAlphabetic(input.charAt(i))) {
            return input.substring(0, i) + Character.toString(input.charAt(i)).toUpperCase()
                    + input.substring(i + 1);
...
Stringcapitalize(String input)
Capitalizes the first letter of a String .
if (input == null) {
    throw new IllegalArgumentException("Input string cannot be null!");
} else if (input.length() < 2) {
    return input.toUpperCase();
return input.substring(0, 1).toUpperCase() + input.substring(1);
Stringcapitalize(String input)
Capitalize a given input string
if (input != null) {
    if ("".equals(input.trim()))
        return input;
    return input.substring(0, 1).toUpperCase() + input.substring(1);
return null;