Struct String

UTF-8 string.

struct String ;

Constructors

NameDescription
this (str, allocator) Constructs the string from a stringish range.
this (init, allocator) Initializes this string from another one.
this (n, chr, allocator) Fills the string with n consecutive copies of character chr.

Properties

NameTypeDescription
capacity[get] ulong
empty[get] boolReturns whether the string is empty.
length[get] ulong

Methods

NameDescription
byCodePoint ()
get () Returns an array used internally by the string. The length of the returned array may be smaller than the size of the reserved memory for the string.
insertAfter (r, el) Inserts el before or after r.
insertBack (chr) Inserts a single character at the end of the string.
insertBack (str) Inserts a stringish range at the end of the string.
insertBefore (r, el)
opAssign (that) Assigns another string.
opAssign (that) Assigns a stringish range.
opCmp (that) Comparison for equality.
opEquals (that) Comparison for equality.
opEquals (that) Comparison for equality.
opIndex (pos)
opIndex ()
opIndexAssign (value, pos) Assigns a value to the character with the index pos.
opIndexAssign (value) Slicing assignment.
opSlice (i, j)
opSliceAssign (value, i, j) Slicing assignment.
remove (r) Remove all characters beloning to r.
reserve (size) Reserves size bytes for the string.
shrink (size) Requests the string to reduce its capacity to fit the size.
toHash () Calculates the hash value for the string.
toStringz () Returns null-terminated string. The returned string is managed by this object and shouldn't be freed.

Aliases

NameDescription
insert Inserts a stringish range at the end of the string.
opDollar