List of utility methods to do String Upper Case
String | toUpperCaseAtFirstChar(String string) to Upper Case At First Char if (isEmpty(string)) { return ""; StringBuffer buffer = new StringBuffer(); buffer.append(string.substring(0, 1).toUpperCase()); buffer.append(string.substring(1, string.length())); return buffer.toString(); |
String | toUpperCaseFirst(String str) to Upper Case First if (str == null) return null; if ("".equals(str)) return str; String first = String.valueOf(str.charAt(0)); str.replaceFirst(first, first.toUpperCase()); return str; |
String | toUpperCaseFirst(String str) to Upper Case First if (str == null) { return null; } else if (str.length() == 0) { return str; } else { String pre = String.valueOf(str.charAt(0)); return str.replaceFirst(pre, pre.toUpperCase()); |
String | toUpperCaseFirst(String str) to Upper Case First return str.replaceFirst(str.substring(0, 1), str.substring(0, 1).toUpperCase());
|
String | toUpperCaseFirst(String text) Changes the first character of the given text to upper case. char[] charArray = text.toCharArray(); charArray[0] = Character.toUpperCase(charArray[0]); return String.valueOf(charArray); |
String | toUpperCaseFirst(String text) to Upper Case First return text.substring(0, 1).toUpperCase() + text.substring(1);
|
String | toUpperCaseFirstAll(String text) Changes the first character of all words in the given text to uppercase. StringBuilder result = new StringBuilder(); String[] words = text.split("\\s"); for (int i = 0; i < words.length; i++) { result.append(toUpperCaseFirst(words[i])); if (i < words.length - 1) { result.append(" "); return result.toString(); |
String | toUpperCaseFirstChar(final String str) Method used to change to upper case the first character of a given string. String firstChar = str.substring(0, 1);
firstChar = firstChar.toUpperCase();
String lastChars = str.substring(1, str.length());
return firstChar + lastChars;
|
String | toUpperCaseFirstChar(String s) to Upper Case First Char if (s != null && s.length() > 0) { return Character.toUpperCase(s.charAt(0)) + s.substring(1); } else { return s; |
String | toUpperCaseFirstChar(String str) set the first character into low case. if (str != null && str.length() > 0) { if (str.length() == 1) { str = str.toUpperCase(); } else { str = str.substring(0, 1).toUpperCase() + str.substring(1); return str; ... |