List of utility methods to do String Lower Case
String | toLowerCaseInitial(String srcString, boolean flag) to Lower Case Initial StringBuilder sb = new StringBuilder(); if (flag) { sb.append(Character.toLowerCase(srcString.charAt(0))); } else { sb.append(Character.toUpperCase(srcString.charAt(0))); sb.append(srcString.substring(1)); return sb.toString(); ... |
String | toLowerCaseSafe(String str) to Lower Case Safe return str == null ? null : str.toLowerCase();
|
String | toLowercaseSlug(String string) Transforms a string into its slug version. String sluggedString = String.join("-", string.split("(?=[A-Z])")); return sluggedString.toLowerCase(); |
String | toLowerCaseSubsystemType(String s) to Lower Case Subsystem Type if (s == null) { return null; if (s.equalsIgnoreCase("CA")) { return "ca"; } else if (s.equalsIgnoreCase("KRA")) { return "kra"; } else if (s.equalsIgnoreCase("OCSP")) { ... |
String | toLowercaseWithDashes(String text) Conver to lowercase with dashes from upper camelcase. char[] chars = text.toCharArray(); StringBuilder sb = new StringBuilder(); boolean isFirst = true; for (char c : chars) { if (isFirst) { sb.append(Character.toLowerCase(c)); isFirst = false; continue; ... |
String | toLowerCaseWithSepStyle(String string, String separator) Converts compound names to the "lower case with separtor style". char[] chars = string.toCharArray(); StringBuffer buffer = new StringBuffer(); for (int i = 0; i < chars.length; i++) { if (Character.isUpperCase(chars[i]) && i > 0 && (Character.isLowerCase(chars[i - 1]) || (i < chars.length - 1 && Character.isLowerCase(chars[i + 1])))) buffer.append(separator); ... |
String | toLowerCaseWithUnderscores(String className) to Lower Case With Underscores StringBuilder sb = new StringBuilder(); for (char c : className.toCharArray()) { if (c >= 'A' && c <= 'Z' && sb.length() > 0) { sb.append('_'); sb.append(Character.toLowerCase(c)); return sb.toString(); ... |
String | toLowerCaseWithUnderscores(String str) to Lower Case With Underscores return null;
|