Text { public static String removeTags(String str) { return TAG_REGEXP.matcher(str).replaceAll(""); }  static List<String> fromCSV(final String input); static String toCSV(final Collection<String> input); static String removeTags(String str); static String removeFormattingTags(String str); static String standardize(String str); static String toJagexName(String str); static String sanitizeMultilineText(String str); static String escapeJagex(String str); static String sanitize(String name); static String titleCase(Enum o); static boolean matchesSearchTerms(Iterable<String> searchTerms, final Collection<String> keywords); static final CharMatcher JAGEX_PRINTABLE_CHAR_MATCHER; }
@Test public void removeTags() { assertEquals("Test", Text.removeTags("<col=FFFFFF>Test</col>")); assertEquals("Test", Text.removeTags("<img=1><s>Test</s>")); assertEquals("Zezima (level-126)", Text.removeTags("<col=ffffff><img=2>Zezima<col=00ffff> (level-126)")); assertEquals("", Text.removeTags("<colrandomtext test>")); assertEquals("Not so much.", Text.removeTags("<col=FFFFFF This is a very special message.</col>Not so much.")); assertEquals("Use Item -> Man", Text.removeTags("Use Item -> Man")); assertEquals("a < b", Text.removeTags("a < b")); assertEquals("a b", Text.removeTags("a <lt> b")); assertEquals("Remove no tags", Text.removeTags("Remove no tags")); }