(s: string): LinesIteratorReturns an IterableIterator which yields each line contained within the
string as well as the trailing newline character.
Example (Iterating lines with separators)
import { String } from "effect"
const lines = String.linesWithSeparators("hello\nworld\n")
console.log(Array.from(lines)) // ["hello\n", "world\n"]splitting
Source effect/String.ts:9911 lines
export const const linesWithSeparators: (
s: string
) => LinesIterator
Returns an IterableIterator which yields each line contained within the
string as well as the trailing newline character.
Example (Iterating lines with separators)
import { String } from "effect"
const lines = String.linesWithSeparators("hello\nworld\n")
console.log(Array.from(lines)) // ["hello\n", "world\n"]
linesWithSeparators = (s: strings: 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(s: strings, false)Referenced by 1 symbols