List of utility methods to do String Case Convert
String | CoverFirstWordUp(String string) Cover First Word Up String str = null; if (string != null && !"".equals(string)) { str = string.substring(0, 1).toUpperCase() + string.substring(1); return str; |
String | toLowerCase(String src) Safely convert the string to lowercase. if (src == null) { return null; } else { return src.toLowerCase(); |
String | swapCase(String str) swap Case if (str == null) { return null; char[] charArray = str.toCharArray(); for (int i = 0; i < charArray.length; i++) { if (Character.isLowerCase(charArray[i])) { charArray[i] = Character.toUpperCase(charArray[i]); } else { ... |
String | toLowerCase(String str) to Lower Case if (str == null) { return null; return str.toLowerCase(); |
String | toLowerCase(String str, int beginIndex, int endIndex) to Lower Case if (str == null) { return null; StringBuilder sb = new StringBuilder(); if (beginIndex < 0) { beginIndex = 0; if (endIndex > str.length()) { ... |
String | toUpperCase(String str) to Upper Case if (str == null) { return null; return str.toUpperCase(); |
String | toUpperCase(String str, int beginIndex, int endIndex) to Upper Case if (str == null) { return null; StringBuilder sb = new StringBuilder(); if (beginIndex < 0) { beginIndex = 0; if (endIndex > str.length()) { ... |
boolean | endsWithIgnoreCase(String str, String suffix) Examine a string to see if it ends with a given suffix (case insensitive). int len = suffix.length(); return str.regionMatches(true, str.length() - len, suffix, 0, len); |
Map | lowercaseKeys(Map Given a map, creates and returns a new map in which all keys are the lower-cased version of each key. Map<String, V> result = new HashMap<String, V>(map.size()); for (Map.Entry<String, V> entry : map.entrySet()) { String key = entry.getKey(); if (result.containsKey(key.toLowerCase())) { throw new IllegalArgumentException( "Duplicate string key in map when lower casing"); result.put(key.toLowerCase(), entry.getValue()); ... |
boolean | startsWithIgnoreCase(String str, String prefix) Examine a string to see if it starts with a given prefix (case insensitive). return str.regionMatches(true, 0, prefix, 0, prefix.length());
|