@Test public void testReplaceLineBreaksWithSpace() { Assert.assertNull(StringUtils.replaceLineBreaksWithSpace(null)); Assert.assertEquals("", StringUtils.replaceLineBreaksWithSpace("")); Assert.assertEquals("foobar", StringUtils.replaceLineBreaksWithSpace("foobar")); Assert.assertEquals("foo bar", StringUtils.replaceLineBreaksWithSpace("foo bar")); Assert.assertEquals("foo bar", StringUtils.replaceLineBreaksWithSpace("foo\nbar")); Assert.assertEquals("foo bar", StringUtils.replaceLineBreaksWithSpace("foo\n\nbar")); Assert.assertEquals("foo bar", StringUtils.replaceLineBreaksWithSpace("foo\rbar")); Assert.assertEquals("foo bar", StringUtils.replaceLineBreaksWithSpace("foo\r\nbar")); Assert.assertEquals("foo bar ", StringUtils.replaceLineBreaksWithSpace("foo\r\nbar\n")); Assert.assertEquals(" foo bar", StringUtils.replaceLineBreaksWithSpace("\rfoo\nbar")); Assert.assertEquals(" foo bar ", StringUtils.replaceLineBreaksWithSpace("\rfoo bar\n")); }
public static String replaceLineBreaksWithSpace(String string) { return replaceLineBreaks(string, SPACE); }
StringUtils { public static String replaceLineBreaksWithSpace(String string) { return replaceLineBreaks(string, SPACE); } }
StringUtils { public static String replaceLineBreaksWithSpace(String string) { return replaceLineBreaks(string, SPACE); } private  StringUtils(); }
StringUtils { public static String replaceLineBreaksWithSpace(String string) { return replaceLineBreaks(string, SPACE); } private  StringUtils(); static String byteToHex(byte[] data); static String replaceLineBreaksWithSpace(String string); static String collapseLineBreaks(String string); static String replaceLineBreaks(String string, String replace); static String removeWhiteSpaces(String string); static String tryTrim(String string); static int getLevenshteinDistance(CharSequence s, CharSequence t); static String join(Object[] array, char separator); static String join(Object[] array, char separator, int startIndex, int endIndex); static String join(Iterator<T> iterator, String separator); static String join(Collection<T> collection, String separator); }
StringUtils { public static String replaceLineBreaksWithSpace(String string) { return replaceLineBreaks(string, SPACE); } private  StringUtils(); static String byteToHex(byte[] data); static String replaceLineBreaksWithSpace(String string); static String collapseLineBreaks(String string); static String replaceLineBreaks(String string, String replace); static String removeWhiteSpaces(String string); static String tryTrim(String string); static int getLevenshteinDistance(CharSequence s, CharSequence t); static String join(Object[] array, char separator); static String join(Object[] array, char separator, int startIndex, int endIndex); static String join(Iterator<T> iterator, String separator); static String join(Collection<T> collection, String separator); static final String EMPTY; static final String SPACE; }