List of utility methods to do String Upper Case
String | toUpperCase(String value) Returns upper-case string if a string is not null or if the trimmed value has a length of > 0. if (!isNullOrEmpty(value)) { value = value.toUpperCase(); return value; |
String | toUpperCase(String value) Converts the given value to upper case. if (value == null) { return null; return value.trim().toUpperCase(); |
String[] | toUpperCase(String[] header) to Upper Case for (int i = 0; i < header.length; i++) { header[i] = header[i].toUpperCase(); return header; |
String[] | toUpperCase(String[] list) convert to uppercase. if (isNullOrEmpty(list)) return list; String[] newList = new String[list.length]; for (int i = 0; i < list.length; i++) { newList[i] = list[i].toUpperCase(); return newList; |
String[] | toUpperCase(String[] source) to Upper Case if (source == null) return source; String[] result = new String[source.length]; for (int i = 0; i < source.length; i++) { result[i] = source[i] == null ? null : source[i].toUpperCase(); return result; |
StringBuffer | toUpperCase(StringBuffer buf) to Upper Case int len = buf.length(); for (int i = 0; i < len; i++) { char lc = buf.charAt(i); char uc = Character.toUpperCase(lc); if (lc != uc) { buf.setCharAt(i, uc); return buf; |
String | toUppercaseAndUnderscore(String string) to Uppercase And Underscore StringBuilder result = new StringBuilder(); boolean lastWasLowerCase = false; for (char i : string.toCharArray()) { if (Character.isUpperCase(i)) { if (lastWasLowerCase) { result.append("_"); result.append(Character.toUpperCase(i)); lastWasLowerCase = Character.isLowerCase(i); return result.toString(); |
void | toUpperCaseArray(String[] source, String[] target) to Upper Case Array for (int i = 0; i < source.length; i++) { if (source[i] != null) { target[i] = source[i].toUpperCase(); |
String | toUpperCaseAscii(String s) Returns a string with all ASCII lower-case letters converted to upper-case. if (s == null) return null; int len = s.length(); char c = 0; boolean hasLowerCase = false; for (int i = 0; i < len; i++) { c = s.charAt(i); if (c >= 'a' && c <= 'z') { ... |
String | toUpperCaseAt(String oldString, int index) Replace character at given index with the same character to upper case int length = oldString.length(); String newString = ""; if ((index >= length) || (index < 0)) { throw new StringIndexOutOfBoundsException( "Index " + index + " is out of bounds for string length " + length); String upper = String.valueOf(oldString.charAt(index)).toUpperCase(); String paddedString = oldString + " "; ... |