@Test public void teststripHtmlTooLong() { final int length = 11; String input = "<b>Formatted <i>Title</i></b>"; String output = InputCleaner.stripHtml(input, length); assertEquals("Formatted T", output); }
public static String stripHtml(final String input, final int maxLength) { String out = input.replaceAll("\\<.*?\\>", ""); if (out.length() > maxLength) { return out.substring(0, maxLength); } return out; }
InputCleaner { public static String stripHtml(final String input, final int maxLength) { String out = input.replaceAll("\\<.*?\\>", ""); if (out.length() > maxLength) { return out.substring(0, maxLength); } return out; } }
InputCleaner { public static String stripHtml(final String input, final int maxLength) { String out = input.replaceAll("\\<.*?\\>", ""); if (out.length() > maxLength) { return out.substring(0, maxLength); } return out; } private  InputCleaner(); }
InputCleaner { public static String stripHtml(final String input, final int maxLength) { String out = input.replaceAll("\\<.*?\\>", ""); if (out.length() > maxLength) { return out.substring(0, maxLength); } return out; } private  InputCleaner(); static String stripHtml(final String input, final int maxLength); }
InputCleaner { public static String stripHtml(final String input, final int maxLength) { String out = input.replaceAll("\\<.*?\\>", ""); if (out.length() > maxLength) { return out.substring(0, maxLength); } return out; } private  InputCleaner(); static String stripHtml(final String input, final int maxLength);  }