boolean (@Nullable CharSequence seq, int fromOffset, int endOffset) { if (seq == null) return false; for (int i = fromOffset; i < endOffset; i++) { char c = seq.charAt(i); if (c == '\n' || c == '\r') return true; } return false; }