Scoop API

scoop:scoop.core:0.1.0

String

class String

source · line 4
public
public class String : Compare<String>, Add<String, String>, Equals<String>, ToString, Hash, Iterable<Char>

Immutable UTF-8 text.

Extensions

function iterator

source · line 71
public
public override operator fun iterator(): Iterator<Char>

Traverses Unicode scalars in order without repeatedly rescanning from the beginning.

function toCharArray

source · line 76
public
public fun toCharArray(): Array<Char>

Copies Unicode scalars into an immutable character array.

function hash

source · line 44
public
public override fun hash(): Long
  • Overrides hash · Hash

Returns a hash consistent with exact string equality.

function toMutableByteArray

source · line 97
public
public fun toMutableByteArray(): MutableArray<Byte>

Copies the UTF-8 encoding into an independently mutable byte array.

function toMutableCharArray

source · line 84
public
public fun toMutableCharArray(): MutableArray<Char>

Copies Unicode scalars into independently mutable character slots.

function toByteArray

source · line 92
public
public fun toByteArray(): Array<Byte>

Copies the UTF-8 encoding into an immutable byte array without a NUL terminator.

function getCharAt

source · line 51
public
public fun getCharAt(idx: Long): Char

Returns the Unicode scalar at a zero-based scalar index by scanning from the beginning, taking O(byteLength) time in the worst case. An invalid index throws IndexOutOfBoundsException. Use iteration for a complete sequential traversal.

property charLength

source · line 13
public
public val charLength: Long

get: public read-only

The number of Unicode scalar values, computed in O(byteLength) time by scanning UTF-8. Combining marks count separately.