// TODO: optimize static S lastLine(S s) { s = dropSuffix("\n", s); s = dropSuffix("\r", s); int i = s.lastIndexOf('\n'); ret substring(s, i+1); }