@Test public void should_trim_trailing_line_separator() { assertThat(TextUtils.trimTrailingLineSeparatorFrom("\r\n")).isEqualTo(""); assertThat(TextUtils.trimTrailingLineSeparatorFrom("\r\nfoo\r\n")).isEqualTo("\r\nfoo"); }
public static String trimTrailingLineSeparatorFrom(String string) { int last; for (last = string.length() - 1; last >= 0; last--) { if (string.charAt(last) != LF && string.charAt(last) != CR) { break; } } return string.substring(0, last + 1); }
TextUtils { public static String trimTrailingLineSeparatorFrom(String string) { int last; for (last = string.length() - 1; last >= 0; last--) { if (string.charAt(last) != LF && string.charAt(last) != CR) { break; } } return string.substring(0, last + 1); } }
TextUtils { public static String trimTrailingLineSeparatorFrom(String string) { int last; for (last = string.length() - 1; last >= 0; last--) { if (string.charAt(last) != LF && string.charAt(last) != CR) { break; } } return string.substring(0, last + 1); } private  TextUtils(); }
TextUtils { public static String trimTrailingLineSeparatorFrom(String string) { int last; for (last = string.length() - 1; last >= 0; last--) { if (string.charAt(last) != LF && string.charAt(last) != CR) { break; } } return string.substring(0, last + 1); } private  TextUtils(); static String escape(char ch); static String trimTrailingLineSeparatorFrom(String string); }
TextUtils { public static String trimTrailingLineSeparatorFrom(String string) { int last; for (last = string.length() - 1; last >= 0; last--) { if (string.charAt(last) != LF && string.charAt(last) != CR) { break; } } return string.substring(0, last + 1); } private  TextUtils(); static String escape(char ch); static String trimTrailingLineSeparatorFrom(String string); static final char CR; static final char LF; }