sS withoutLinesEmptyAfterTrim(S text) { LS lines = filter(lines(text), s -> !emptyAfterTrim(s)); ret lines_possiblyRTrim(text, lines); }