static ItIt lineStartIndexesIterator(S s) { ret new ItIt { int i; public bool hasNext() { ret i >= 0; } public Int next() { int j = i; i = indexOf(s, '\n', i); if (i >= 0) ++i; ret j; } }; }