List of utility methods to do String Sanitize
String | sanitize(String string) sanitize string = string.replace(" ", ""); string = string.replace(")(", ")*("); StringBuilder result = new StringBuilder(""); int depth = 0; for (int i = 0; i < string.length(); i++) { if (string.charAt(i) == '-' && depth == 0) { result.append("+(-1)*"); } else { ... |
String | sanitize(String string, boolean allowWhitespace) sanitize if (allowWhitespace) { return string.replaceAll("[^A-Za-z0-9_ ]", ""); return string.replaceAll("[^A-Za-z0-9_]", ""); |
String | sanitize(String string, String spaceReplace) Sanitizes the provided message, removing any non-alphanumeric characters and swapping spaces with the specified string. return string.replaceAll("[^\\dA-Za-z ]", "").replaceAll("\\s+", spaceReplace); |
String | sanitize(String text) sanitize if (text != null) return text.replaceAll("[,|;|\\.|-]", ""); return ""; |
String | sanitize(String text) sanitize String result = text;
result = result.replaceAll(CHAR_8220, CHAR_QUOTE);
result = result.replaceAll(CHAR_8221, CHAR_QUOTE);
result = result.replaceAll(CHAR_8222, CHAR_QUOTE);
return result;
|
String | sanitize(String value) Remove non-alphabetic characters from a string return value.toLowerCase().replaceAll("[^a-zA-Z]", ""); |
String | sanitizeAppAlias(String appAlias) Make sure the app alias only has alphanumeric and common punctuation characters. if (appAlias == null) { return null; } else { return appAlias.replaceAll("[^\\w\\-'\"\\s]", ""); |
String | sanitizeAttribute(String value) Nukes special attribute characters. for (int ii = 0; ii < ATTR_ESCAPES.length; ++ii) { value = value.replace(ATTR_ESCAPES[ii][0], ""); return value; |
String | sanitizeBranchName(String currentBranch) sanitize Branch Name return currentBranch.replaceAll("[\\s\\-#/\\\\]+", "_"); |
String | sanitizeBrowserName(String browserName) sanitize Browser Name browserName = browserName.toLowerCase(); browserName = browserName.replace("mobile", "").trim(); return browserName; |