(self: string): LinesIteratorReturns an IterableIterator which yields each line contained within the
string, trimming off the trailing newline character.
Example (Iterating lines without separators)
import { String } from "effect"
const lines = String.linesIterator("hello\nworld\n")
console.log(Array.from(lines)) // ["hello", "world"]splitting
Source effect/String.ts:9731 lines
export const const linesIterator: (
self: string
) => LinesIterator
Returns an IterableIterator which yields each line contained within the
string, trimming off the trailing newline character.
Example (Iterating lines without separators)
import { String } from "effect"
const lines = String.linesIterator("hello\nworld\n")
console.log(Array.from(lines)) // ["hello", "world"]
linesIterator = (self: stringself: string): class LinesIteratorclass LinesIterator {
index: number;
length: number;
s: string;
stripped: boolean;
next: () => IteratorResult<string>;
done: boolean;
}
LinesIterator => const linesSeparated: (
self: string,
stripped: boolean
) => LinesIterator
linesSeparated(self: stringself, true)