@Test public void testremoveDuplicate_TAB() { ConvertString convertString = new ConvertString("\t"); String input = "a\tbccccdeaa\t\t\t\t\t\ty"; Assert.assertEquals("a\tbccccdeaa\ty", convertString.removeRepeatedChar(input)); }
public String removeRepeatedChar(String input) { if (StringUtils.isEmpty(input) || StringUtils.isEmpty(repeatChar) || removeRepeatCharPattern == null) { return input; } Matcher matcher = removeRepeatCharPattern.matcher(input); return matcher.replaceAll(repeatChar); }
ConvertString { public String removeRepeatedChar(String input) { if (StringUtils.isEmpty(input) || StringUtils.isEmpty(repeatChar) || removeRepeatCharPattern == null) { return input; } Matcher matcher = removeRepeatCharPattern.matcher(input); return matcher.replaceAll(repeatChar); } }
ConvertString { public String removeRepeatedChar(String input) { if (StringUtils.isEmpty(input) || StringUtils.isEmpty(repeatChar) || removeRepeatCharPattern == null) { return input; } Matcher matcher = removeRepeatCharPattern.matcher(input); return matcher.replaceAll(repeatChar); } ConvertString();  ConvertString(String repeatStr); }
ConvertString { public String removeRepeatedChar(String input) { if (StringUtils.isEmpty(input) || StringUtils.isEmpty(repeatChar) || removeRepeatCharPattern == null) { return input; } Matcher matcher = removeRepeatCharPattern.matcher(input); return matcher.replaceAll(repeatChar); } ConvertString();  ConvertString(String repeatStr); String removeTrailingAndLeadingWhitespaces(String input); String removeTrailingAndLeading(String input); String removeTrailingAndLeading(String input, String character); String removeRepeatedChar(String input); String removeRepeatedWhitespaces(String input); }
ConvertString { public String removeRepeatedChar(String input) { if (StringUtils.isEmpty(input) || StringUtils.isEmpty(repeatChar) || removeRepeatCharPattern == null) { return input; } Matcher matcher = removeRepeatCharPattern.matcher(input); return matcher.replaceAll(repeatChar); } ConvertString();  ConvertString(String repeatStr); String removeTrailingAndLeadingWhitespaces(String input); String removeTrailingAndLeading(String input); String removeTrailingAndLeading(String input, String character); String removeRepeatedChar(String input); String removeRepeatedWhitespaces(String input); static final String[] WHITESPACE_CHARS; }