Package-level declarations

Types

Link copied to clipboard
class TextPtr(val text: CharSequence, charIndex: Int = 0)

A class which points at a character index within a text string, where the index can be incremented and decremented.

Functions

Link copied to clipboard
fun TextPtr.readUntil(condition: TextPtr.() -> Boolean): String

Read the current string up until we reach a point where the condition is no longer true.

Link copied to clipboard
fun TextPtr.startsWith(value: Char, ignoreCase: Boolean = false): Boolean

Checks if the current text begins with the target character.

fun TextPtr.startsWith(value: String, ignoreCase: Boolean = false): Boolean

Checks if the current text begins with the target string.

Link copied to clipboard
fun TextPtr.substring(length: Int): String

Return a substring for the current text.

Link copied to clipboard

Attempt to read the current text as an integer value, updating the text pointer to point past the read value, or return null if not possible.