List of utility methods to do String Decamel Case
String | decamel(String name) decamel if (name == null) return null; return name.replaceAll(String.format("%s|%s|%s", "(?<=[A-Z])(?=[A-Z][a-z])", "(?<=[^A-Z])(?=[A-Z])", "(?<=[A-Za-z])(?=[^A-Za-z])"), " "); |
String | deCamelCap(String s) de Camel Cap if (s.length() == 0) return s; return Character.toUpperCase(s.charAt(0)) + deCamel(s.substring(1)); |
String | deCamelCase(final String original) Converts a camel cased string into an underscored one, e.g. if (original == null) return null; if (original.isEmpty()) return original; return original.replaceAll("(.)(\\p{Upper})", "$1_$2").toLowerCase(); |
String | deCamelCase(String camelCased, String delim) de Camel Case final StringBuilder path = new StringBuilder(); boolean lastUpper = true; for (char c : camelCased.toCharArray()) { if (Character.isUpperCase(c)) { c = Character.toLowerCase(c); if (!lastUpper) { lastUpper = true; path.append(delim); ... |
String | deCamelCase(String identifier) de Camel Case if (identifier == null || identifier.isEmpty()) { return null; StringBuilder nameBuilder = new StringBuilder(); for (int i = 0; i < identifier.length(); i++) { char c = identifier.charAt(i); if (i == 0) { nameBuilder.append(Character.toUpperCase(c)); ... |
String | deCamelCaseStyle(String style) convert for example backgrounColor to background-color String property = ""; for (int j = 0; j < style.length(); j++) { char character = style.charAt(j); if (Character.isUpperCase(character)) { property += "-" + Character.toLowerCase(character); } else { property += character; return property; |
String | decamelise(String testName) decamelise String nocamel = charAtToUpper(0, testName); for (int i = 1; i < testName.length(); i++) { char nextChar = testName.charAt(i); if (isUpper(nextChar)) { nocamel += spaceAndToLower(nextChar); } else { nocamel += nextChar; return nocamel; |
String | decamelize(final String s) decamelize if (s == null) { return null; if (s.length() == 1) { return s.toUpperCase(); StringBuilder buf = new StringBuilder(40); int pos = 0; ... |
String | decamelize(String s) decamelize if (s == null || s.equals("")) { return s; StringBuffer buf = new StringBuffer(); buf.append(Character.toLowerCase(s.charAt(0))); for (int i = 1; i < s.length(); i++) { if (Character.isUpperCase(s.charAt(i))) { if (s.length() > i + 1 && Character.isLowerCase(s.charAt(i + 1))) { ... |
String | deCamelize(String value) de Camelize if (value == null) { return null; StringBuilder deCamelized = new StringBuilder(value.length() + 10); for (int i = 0; i < value.length(); i++) { if (Character.isUpperCase(value.charAt(i)) && deCamelized.length() > 0) { deCamelized.append('_'); deCamelized.append(Character.toUpperCase(value.charAt(i))); return deCamelized.toString(); |