@Test public void testRemoveSymbols() { logger.info("removeSymbols"); String text = "test ` ~ ! @ # $ % ^ & * ( ) _ - + = < , > . ? / \" ' : ; [ { } ] | \\ test `~!@#$%^&*()_-+=<,>.?/\\\"':;[{}]|\\\\ test"; String expResult = "test _ test _ test"; String result = StringCleaner.removeExtraSpaces(StringCleaner.removeSymbols(text)); assertEquals(expResult, result); }
public static String removeSymbols(String text) { text = text.replaceAll("[^\\p{L}\\p{Z}_]",""); return text; }
StringCleaner { public static String removeSymbols(String text) { text = text.replaceAll("[^\\p{L}\\p{Z}_]",""); return text; } }
StringCleaner { public static String removeSymbols(String text) { text = text.replaceAll("[^\\p{L}\\p{Z}_]",""); return text; }  }
StringCleaner { public static String removeSymbols(String text) { text = text.replaceAll("[^\\p{L}\\p{Z}_]",""); return text; }  static String tokenizeURLs(String text); static String tokenizeSmileys(String text); static String removeExtraSpaces(String text); static String removeSymbols(String text); static String unifyTerminators(String text); static String removeAccents(String text); static String clear(String text); }
StringCleaner { public static String removeSymbols(String text) { text = text.replaceAll("[^\\p{L}\\p{Z}_]",""); return text; }  static String tokenizeURLs(String text); static String tokenizeSmileys(String text); static String removeExtraSpaces(String text); static String removeSymbols(String text); static String unifyTerminators(String text); static String removeAccents(String text); static String clear(String text);  }