@Test public void testremoveDuplicate_CRLF() { ConvertString convertString = new ConvertString("\r\n"); String input = "a\r\nbccccdeaa\r\n\r\n\r\ny"; Assert.assertEquals("a\r\nbccccdeaa\r\ny", 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; }