List of utility methods to do String Clean
String | cleanStringForJavaName(String original) clean String For Java Name if (original == null || original.isEmpty()) return original; char[] origChars = original.toCharArray(); char[] cleanChars = new char[origChars.length]; boolean isIdentifierStart = true; for (int i = 0; i < origChars.length; i++) { char curChar = origChars[i]; if (curChar != '$' && (isIdentifierStart ? Character.isJavaIdentifierStart(curChar) ... |
String | cleanStringFromWhitespaces(String text) clean String From Whitespaces return text.replaceAll(" ", " ").trim(); |
String | cleanText(final String input) Cleans a string for of insignificant whitespace if (input == null) return ""; String retValue = input.replaceAll("\\r\\n|\\r|\\n|\\t", " "); while (retValue.indexOf(" ") != -1) retValue = retValue.replaceAll(" ", " "); return retValue; |
String | cleanText(String s) clean Text s = s.trim(); int len = s.length(); StringBuffer cleanValue = new StringBuffer(len); for (int i = 0; i < len; i++) { char ch = s.charAt(i); if (ch > 127) { System.out.println( "WARNING: Non ASCII character " + ch + " (" + (int) ch + ") in following string\n" + s); ... |
String | cleanText(String s) clean Text return s.replaceAll("\\W", ""); |
String | cleanText(String t) clean Text t = t.replaceAll("(,|:|;)", " "); t = t.replaceAll(" ", " "); t = t.replaceAll("\\n", " "); t = t.replaceAll("([\\.]\\s)", ".1. .0. "); t = t.replaceAll(" ", " "); t = t.replaceAll(" ", " "); t = t.trim(); return t; ... |
String | cleanText(String text) Clean a string from left-over WikiMarkup (most parsers do not work 100% correct). String plainText = text; plainText = plainText.replaceAll("<.+?>", " "); plainText = plainText.replaceAll("__.+?__", " "); plainText = plainText.replaceAll("\\[http.+?\\]", " "); plainText = plainText.replaceAll("\\{\\|.+?\\|\\}", " "); plainText = plainText.replaceAll("\\{\\{.+?\\}\\}", " "); plainText = plainText.replaceAll(" - ", " "); plainText = plainText.replace('"', ' '); ... |
String | cleanText(String text) clean Text if (text.startsWith("define ")) { text = text.substring(7, text.length()); return text; |
String | cleanText(String text) removes some non-standard characters from a string if (text != null) { text = text.replaceAll("&", "&"); text = text.replaceAll("_", " "); text = text.replaceAll(" ", " "); return text; |
String | cleanText(String text) Cleans text so it can be shown properly. return text.replaceAll("&", "&"); |