List of utility methods to do String Camel Case
String | camelCase(String inStr, int start, int end) camel Case String outStr = ""; outStr += inStr.substring(0, start).toLowerCase(); outStr += inStr.substring(start, end + 1).toUpperCase(); if (end < inStr.length()) { outStr += inStr.substring(end + 1).toLowerCase(); return (outStr); |
String | camelCase(String key) camel Case StringBuilder sb = new StringBuilder(key.length()); boolean upper = true; for (int i = 0; i < key.length(); i++) { char c = key.charAt(i); if (upper) { sb.append(Character.toUpperCase(c)); } else { sb.append(Character.toLowerCase(c)); ... |
String | camelCase(String name, boolean capitalize) Converts a name to 'camelCase': hyphens are removed, letters following hyphens are converted to uppercase. if (name == null || name.length() < 1) return name; StringBuffer n = new StringBuffer(name.length()); n.append(capitalize ? Character.toUpperCase(name.charAt(0)) : name.charAt(0)); for (int i = 1, L = name.length(); i < L; i++) { char c = name.charAt(i); if (c != '-') n.append(c); ... |
String | camelCase(String s) camel Case return toCase(s, true);
|
byte[] | camelCase(String s) camel Case byte[] b = s.getBytes(); boolean camel = true; for (int i = 0; i < b.length; i++) { if (b[i] >= 97 && b[i] <= 122 && camel) { b[i] = (byte) (b[i] - 32); camel = false; if (b[i] == 32 && !camel) { ... |
String | camelCase(String s) Converts a string to camel case, assuming '_' as the word separator. return camelCase(s, '_'); |
String | camelCase(String s) camel Case return camelCase(s, true);
|
String | camelCase(String s) camel Case if (s == null || s.length() < 2) return null; String firstLetter = s.substring(0, 1).toUpperCase(); return firstLetter + s.substring(1).toLowerCase(); |
String | CamelCase(String str) Camel Case if (str == null) { return ""; if (str.length() <= 0) { return ""; return String.valueOf(str.toUpperCase().charAt(0)) + str.substring(1).toLowerCase(); |
String | camelCase(String str) camel Case StringBuilder sb = new StringBuilder(); char[] chs = str.toCharArray(); boolean isUnderLine = false; for (int i = 0; i < chs.length; i++) { char ch = chs[i]; if (ch == '_') { isUnderLine = true; } else { ... |