List of utility methods to do String Capitalize
String | capitalize(String value) Capitalize. if (value == null) { return value; return value.substring(0, 1).toUpperCase() + value.substring(1); |
String | capitalize(String var) capitalize return capitalize(var, false); |
String | capitalize(String word) capitalize String capitalizedWord = word; if (Character.isLowerCase(word.charAt(0))) { capitalizedWord = "" + Character.toUpperCase(word.charAt(0)) + word.substring(1); return capitalizedWord; |
String | capitalize(String word) capitalize String[] words = word.split(" "); StringBuilder res = new StringBuilder(); for (String w : words) { res.append(capitalizeSingle(w)); return res.toString(); |
String | capitalize(String word) Capitalize the first word of the passed String. if (word == null) return null; if (word.length() == 0) return word; StringBuilder s = new StringBuilder(word.toLowerCase()); char c = s.charAt(0); s.setCharAt(0, Character.toUpperCase(c)); return s.toString(); ... |
String | capitalize(String word) capitalize if (word.length() == 0) return word; switch (word) { case "of": case "the": case "in": case "with": case "and": ... |
String | capitalize(String word) capitalize StringBuilder buff = new StringBuilder(word); if (word.charAt(0) != '_') { buff.setCharAt(0, Character.toUpperCase(word.charAt(0))); for (int i = 1; i < buff.length(); i++) { if (buff.charAt(i - 1) == '_') { buff.setCharAt(i, Character.toUpperCase(word.charAt(i))); return buff.toString().replace("_", ""); |
String | capitalize(String word) capitalize if (isBlank(word)) { return word; } else { return word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase(); |
String | capitalize(String word) capitalize StringBuilder sb = new StringBuilder(word); sb.setCharAt(0, Character.toUpperCase(sb.charAt(0))); return sb.toString(); |
String | capitalize(String words) capitalize StringBuffer buffer = new StringBuffer(); boolean isNewWord = true; int length = words.length(); for (int i = 0; i < length; ++i) { char c = words.charAt(i); if (Character.isWhitespace(c)) { isNewWord = true; } else if (isNewWord) { ... |