sS substringWithEllipsis(S s, int x, int y) { S sub = substring(s, x, y); if (x > 0) sub = "..." + sub; if (y < l(s)) sub += "..."; ret sub; }