Java Utililty Methods String Capitalize All

List of utility methods to do String Capitalize All

Description

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

Method

StringcapitaliseAll(String str)
Method capitaliseAll.
String result = "";
char ch; 
char prevCh; 
int i; 
if (str != null) {
    prevCh = '.'; 
    for (i = 0; i < str.length(); i++) {
        ch = str.charAt(i);
...
StringcapitaliseAllWords(String str)
Capitalise all the words in a string.
if (str == null) {
    return null;
int sz = str.length();
StringBuffer buffer = new StringBuffer(sz);
boolean space = true;
for (int i = 0; i < sz; i++) {
    char ch = str.charAt(i);
...
StringcapitaliseAllWords(String str)
capitalise All Words
return capitalize(str);
StringcapitaliseAllWords(String str)
capitalise All Words
return capitalizeString(str);
StringcapitalizeAll(final String value)
Transforms all the first letters of words in UpperCase (Capitalized)
if (value == null)
    return null;
if (value.trim().isEmpty())
    return value;
StringBuilder sb = new StringBuilder(value.length());
char[] arr = value.toCharArray();
boolean flagUpper = false;
for (int i = 0; i < arr.length; i++) {
...
StringcapitalizeAll(String string)
First-letter capitalizes a string.
String[] tokens = string.split(" ");
StringBuilder stringBuilder = new StringBuilder();
for (String token : tokens) {
    stringBuilder.append(token.substring(0, 1).toUpperCase());
    stringBuilder.append(token.substring(1).toLowerCase());
    stringBuilder.append(" ");
if (stringBuilder.length() > 0) {
...
StringcapitalizeAll(String text)
capitalize All
if (text == null || text.length() == 0)
    return "null";
text = text.toLowerCase();
String result = "";
for (int i = 0; i < text.length(); i++) {
    if (i == 0 || i > 1 && text.charAt(i - 1) == ' ')
        result += Character.toString(text.charAt(i)).toUpperCase();
    else
...
StringcapitalizeAllFirstChar(String text)
Sample1: S E S submit date -> S E S Submit Date
if (text != null) {
    StringBuilder builder = new StringBuilder(text);
    for (int i = 0, count = builder.length(); i < count; i++) {
        char c = builder.charAt(i);
        if (i == 0) {
            if (c >= 97 && c <= 122) {
                builder.deleteCharAt(i);
                builder.insert(i, Character.toUpperCase(c));
...
StringcapitalizeAllWords(String text)
Capitalizes all words in a string
String[] Split = text.split("_");
String Out = "";
for (int i = 0; i < Split.length; i++) {
    Out += capitalize(Split[i]);
    if (i < Split.length) {
        Out += "_";
return Out;
StringcapitalizeAllWords(String words)
capitalize All Words
StringBuilder out = new StringBuilder();
if (words.length() > 0) {
    String[] wordList = words.trim().split(" ");
    for (int i = 0; i < wordList.length; i++) {
        if (wordList[i].length() > 1) {
            wordList[i] = wordList[i].substring(0, 1).toUpperCase()
                    + wordList[i].substring(1).toLowerCase();
        } else {
...