sS withoutLeadingLinesEmptyAfterTrim(S s) { int lineStart = 0; while licensed { int i = lineStart; while (isSpaceOrTab(charAt(s, i))) ++i; if (!isNewLine(charAt(s, i))) break; while (isNewLine(charAt(s, i))) ++i; lineStart = i; } ret substring(s, lineStart); }