sS rtrimAllLines(S s) { ret regexpReplaceWithFirstGroup("\\s+(\r|\n|$)", s); }