List of utility methods to do String Capitalize
void | capitalize(StringBuilder text) capitalize if (text.length() == 0) { return; text.setCharAt(0, Character.toUpperCase(text.charAt(0))); |
void | capitalizeAt(StringBuilder builder, int index) Capitalize character at index. char c = builder.charAt(index); char capitalized = Character.toUpperCase(c); if (c != capitalized) { builder.setCharAt(index, capitalized); |
String | capitalizeClass(String className) Capitalizes a full qualified class name. StringBuilder builder = new StringBuilder(className.length()); int packageIndex = className.lastIndexOf("."); if (packageIndex != -1) { builder.append(className.substring(0, packageIndex + 1)); builder.append(Character.toUpperCase(className.charAt(packageIndex + 1))); builder.append(className.substring(packageIndex + 2)); className = builder.toString(); ... |
String | capitalized(String s) capitalized return s.substring(0, 1).toUpperCase() + s.substring(1);
|
String | capitalized(String s) capitalized return isNullOrEmpty(s) ? s : s.substring(0, 1).toUpperCase() + s.substring(1);
|
String | capitalized(String str) capitalized if (str == null) { return null; if (str.length() > 0) { return str.substring(0, 1).toUpperCase() + str.substring(1); return str; |
String | capitalizeD(String str, char[] delimiters) capitalize D int delimLen = (delimiters == null ? -1 : delimiters.length); if (str == null || str.length() == 0 || delimLen == 0) { return str; int strLen = str.length(); StringBuilder buffer = new StringBuilder(strLen); boolean capitalizeNext = true; for (int i = 0; i < strLen; i++) { ... |
String[] | capitalizedArray(String[] sstr) check each word in the given string array is capitalized or not Input: array of strings Output: U U L L U L U L L L U L.... String[] cap = new String[sstr.length]; int i = 0; for (String s : sstr) { if (Character.isUpperCase(s.charAt(0))) cap[i] = "U"; else cap[i] = "L"; i++; ... |
String | capitalizedCase(CharSequence source, char... delimiters) capitalized Case int delimitersCount = delimiters == null ? -1 : delimiters.length; if (isEmpty(source) || delimitersCount == 0) { return source.toString(); char[] buffer = source.toString().toLowerCase().toCharArray(); boolean capitalizeNext = true; for (int i = 0; i < buffer.length; i++) { char ch = buffer[i]; ... |
String | capitalizedName(final String property) capitalized Name if (null == property || property.length() < 1) return property; final char[] chars = property.toCharArray(); chars[0] = Character.toUpperCase(chars[0]); return new String(chars); |