ImmutableStringReader

Properties

Link copied to clipboard
abstract val cursor: Int

The current cursor position.

Link copied to clipboard
open val previous: String

The substring from the start of the string to the current cursor position.

Link copied to clipboard
open val remaining: String

The substring from the current cursor position to the end of the string.

Link copied to clipboard

The number of characters remaining that may be read.

Link copied to clipboard
abstract val string: String

The underlying string.

Link copied to clipboard
open val totalLength: Int

The total number of characters in the string.

Functions

Link copied to clipboard
open fun canRead(): Boolean

Whether 1 character can be read.

open fun canRead(length: Int): Boolean

Whether length number of characters can be read.

Link copied to clipboard
open fun peek(): Char

Returns the character at the current cursor position but does not advance the cursor.

open fun peek(offset: Int): Char

Returns the character at the current cursor position + offset but does not advance the cursor.