effect-io-ai

Package: effect
Module: String

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"]

Signature

declare const linesIterator: (self: string) => LinesIterator

Source

Since v2.0.0