sS joinLinesWithBarOrPunctuation(S text) { LS lines = tlft(text); new StringBuilder buf; for (S s : lines) { buf.append(s); if (endsWithPunctuation(s)) buf.append(" "); else buf.append(" | "); ret trim(str(buf)); }