Java Utililty Methods String Capitalize Word

List of utility methods to do String Capitalize Word

Description

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

Method

StringcapitalizeInitials(String words)
capitalize Initials
String[] broken = words.split(" ");
StringBuilder result = new StringBuilder();
for (String word : broken) {
    if (result.length() > 0) {
        result.append(" ");
    result.append(Character.toUpperCase(word.charAt(0))).append(word.substring(1));
return result.toString();
StringcapitalizeOneWord(String inputWord)
Capitalize one word.
String firstLetter = inputWord.substring(0, 1); 
String remainder = inputWord.substring(1); 
return firstLetter.toUpperCase() + remainder.toLowerCase();
StringcapitalizeSingle(String word)
capitalize Single
return word.substring(0, 1).toUpperCase() + word.substring(1);
StringcapitalizeWord(String s)
Capitalises the first letter of a given string.
if ((s == null) || (s.length() == 0)) {
    return s;
return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
StringcapitalizeWord(String s)
capitalize Word
if (s.length() > 1) {
    return s.substring(0, 1).toUpperCase() + s.substring(1, s.length()).toLowerCase();
return s.toUpperCase();
StringcapitalizeWord(String str)
capitalize Word
int strLen;
if (str == null || (strLen = str.length()) == 0) {
    return str;
return new StringBuilder(strLen).append(Character.toTitleCase(str.charAt(0))).append(str.substring(1))
        .toString();
StringcapitalizeWord(String word)
capitalize Word
return word.substring(0, 1).toUpperCase() + word.substring(1);
StringcapitalizeWord(String word)
Convert the initial of given string word to upper case.
String result = null;
if ((word != null) && (word.trim().length() > 0)) {
    result = word.substring(0, 1).toUpperCase() + word.substring(1);
} else {
    result = word;
return result;
StringcapitalizeWord(String word)
Capitalizes a word.

For example:

 Util.capitalizeWord("bean"); 
will return
Bean
.
int len = word.length();
if (len == 1)
    return word.toUpperCase();
return word.substring(0, 1).toUpperCase() + word.substring(1);
StringcapitalizeWords(final String text)
Capitalizes the first letter of every "word" in a string.
if (text.isEmpty())
    return text;
final char[] chars = text.toCharArray();
chars[0] = Character.toUpperCase(chars[0]);
final int checkLenth = text.length() - 1;
for (int i = 0; i < checkLenth;) {
    if (Character.isWhitespace(chars[i++]))
        chars[i] = Character.toUpperCase(chars[i]);
...