static S beforeLineBreak(S s) { int i = smartIndexOf(s, '\n'); if (i > 0 && s.charAt(i-1) == '\r') --i; ret substring(s, 0, i); }