List of utility methods to do String Sanitize
String | sanitizeSuiteName(String name) Returns a sanitized suite name suitable for inclusion in a XML report. return name.replaceAll("[[\\p{Punct}][\\p{Space}]&&[^_.-]]", "-").replaceAll("[.]+$", ""); |
String | sanitizeTag(String s) sanitize Tag if (s.length() > MAX_TAG_LENGTH) { s = s.substring(s.length() - MAX_TAG_LENGTH); return s; |
String | sanitizeTextAsDomId(final String text) sanitize Text As Dom Id return text.toLowerCase().replace(" ", "-"); |
String | sanitizeTimezones(String s) sanitize Timezones return s.replaceAll("[\\+\\-]\\d\\d\\d\\d", "+0000"); |
String | sanitizeTokenString(final String tokenString) Returns a "sanitized" version of the given token string suitable for sending to an APNs server. return tokenString.replaceAll("[^a-fA-F0-9]", ""); |
String | sanitizeToLineFeed(CharSequence string) sanitize To Line Feed StringBuilder sb = new StringBuilder(); for (int i = 0, len = string.length(); i < len; i++) { char c = string.charAt(i); boolean legal = c == '\u0009' || c == '\n' || (c >= '\u0020' && c <= '\uD7FF') || (c >= '\uE000' && c <= '\uFFFD'); if (legal) { sb.append(c); return sb.toString(); |
long | sanitizeToLong(String origMSISDN) sanitize To Long return Long.parseLong(sanitizeToString(origMSISDN));
|
String | sanitizeToString(String origMSISDN) sanitize To String origMSISDN = origMSISDN.trim(); return origMSISDN.startsWith("86") ? origMSISDN : "86" + origMSISDN; |
String | sanitizeTypename(String name) Rewrites a type name so that it can be executed in code. return name.replace('$', '.'); |
String | sanitizeUnicode(String str) sanitize Unicode if (str == null) { return null; StringBuilder buf = new StringBuilder(); int len = str.length(); for (int i = 0; i < len; i++) { char ch = str.charAt(i); if (Character.isHighSurrogate(ch) || Character.isLowSurrogate(ch)) { ... |