TextIterator

interface TextIterator

A text iterator iterates over a sequence of strings. When iterating over a Text document, result values will either be lines or line breaks.

Properties

Link copied to clipboard
abstract val done: Boolean

Whether the end of the iteration has been reached. You should probably check this right after calling next.

Link copied to clipboard
abstract val lineBreak: Boolean

Whether the current string represents a line break.

Link copied to clipboard
abstract val value: String

The current string. Will be the empty string when the cursor is at its end or next hasn't been called on it yet.

Functions

Link copied to clipboard
abstract fun next(skip: Int = 0): TextIterator

Retrieve the next string. Optionally skip a given number of positions after the current position. Always returns the object itself.