List of utility methods to do String Capitalize
String | capitalize(String src) capitalize StringBuffer buffer = new StringBuffer(src.length()); char c = src.charAt(0); buffer.append(Character.toTitleCase(c)); for (int i = 1; i < src.length(); i++) { buffer.append(src.charAt(i)); return buffer.toString(); |
String | capitalize(String str) capitalize return !isNull(str) ? str.substring(0, 1).toUpperCase() + str.substring(1).toLowerCase() : str;
|
String | capitalize(String str) capitalize int strLen; if ((str == null) || ((strLen = str.length()) == 0)) { return str; return strLen + Character.toTitleCase(str.charAt(0)) + str.substring(1); |
String | capitalize(String str) Capitalize the first character in the string if necessary. if (str == null) { return str; int strLen = str.length(); if (strLen == 0) { return str; char first = Character.toTitleCase(str.charAt(0)); ... |
String | capitalize(String str) capitalize 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(); |
String | capitalize(String str) Capitalize a String , changing the first letter to upper case as per Character#toUpperCase(char) .
return changeFirstCharacterCase(str, true);
|
String | capitalize(String str) capitalize String capitalized = ""; for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (i == 0) { c = Character.toUpperCase(c); capitalized += c; return capitalized; |
String | capitalize(String str) capitalize StringBuilder sb = new StringBuilder(); char ch; char prevCh; int i; prevCh = '.'; for (i = 0; i < str.length(); i++) { ch = str.charAt(i); if (Character.isLetter(ch) && !Character.isLetter(prevCh)) { ... |
String | capitalize(String str) Capitalize given string by transforming the first character to upper case. StringBuilder buff = new StringBuilder(str.length()); buff.append(Character.toUpperCase(str.charAt(0))); buff.append(str.substring(1)); return buff.toString(); |
String | capitalize(String str) capitalize int strLen = 0; if (str != null) if ((strLen = str.length()) != 0) return str; return strLen + Character.toTitleCase(str.charAt(0)) + str.substring(1); |