SplitScript reference / String

String

type

String

Stores ordinary immutable UTF-8 text in WebAssembly GC memory.

String literals, interpolation, process decoders, and timer variables all produce this same type. A decoded string owns its GC storage and is not a view into target-process memory. Decoder bounds such as utf8(64) describe the memory operation, not distinct String types.

Examples

Store owned text

let character: String = "Toree"

Capabilities

MemberDescriptionAvailable through
DebugProduces an unambiguous structural representation of a value.
DisplaySupports conversion to a user-facing textual representation.
EquatableSupports equality comparison.

Operators

MemberDescriptionAvailable through
==Reports whether this value and another value are equal.Available through Equatable
!=Reports whether this value and another value differ.Available through Equatable

Methods

MemberDescriptionAvailable through
debugStringConverts the receiver to its unambiguous structural representation.Available through Debug
toStringConverts the receiver to its user-facing string representation.Available through Display
byteAtReturns the raw UTF-8 byte at an offset.
byteLengthReturns a string's UTF-8 byte length.
charAtReturns the Unicode character beginning at a UTF-8 byte offset.
concatConcatenates an array of strings.
containsTests whether this string contains an exact substring.
endsWithTests whether this string ends with an exact suffix.
equalsIgnoreAsciiCaseCompares two strings while ignoring ASCII letter case.
indexOfFinds the first exact substring and returns its UTF-8 byte offset.
isBlankReports whether this string is empty or contains only Unicode whitespace.
isEmptyReports whether this string contains no UTF-8 bytes.
joinJoins an array of strings with one separator between adjacent values.
lastIndexOfFinds the last exact substring and returns its UTF-8 byte offset.
padEndPads the end of this string to a minimum Unicode-scalar length.
padStartPads the beginning of this string to a minimum Unicode-scalar length.
parseParses this string as an inferred numeric type.
replaceAllReplaces every exact, non-overlapping occurrence of a string.
sliceExtracts text between two UTF-8 byte offsets.
splitSplits this string at every exact, non-overlapping delimiter.
startsWithTests whether this string starts with an exact prefix.
toAsciiLowerCaseReturns this string with ASCII uppercase letters converted to lowercase.
toAsciiUpperCaseReturns this string with ASCII lowercase letters converted to uppercase.
trimAsciiWhitespaceRemoves ASCII whitespace from both ends of this string.