Skip to content

Strings ​

Strings are heap objects. Mnemonics that accept an existing string expect a register containing an ObjectRef to a String, unless described otherwise. See CandleVM string opcodes for conversion details.

CASM mnemonicCandleVM opcodeOperandsBehavior
str_newNewStringdestination, "text"Creates a string from a quoted UTF-8 literal.
str_lenStringLendestination, stringWrites the number of Unicode scalar values to destination.
str_concatStringConcatdestination, left, rightConcatenates two strings into a new string.
str_from_charsStringFromCharsdestination, arrayBuilds a string from an array of characters.
str_to_charsStringToCharsdestination, stringCreates an array containing the string's Unicode scalar values.
str_from_bytesStringFromBytesdestination, bufferDecodes a buffer as UTF-8 into a new string.
str_to_bytesStringToBytesdestination, stringCopies a string's UTF-8 bytes into a new buffer.
str_ofStringOfdestination, valueFormats a value as a new string.
str_lowercaseStringLowercasedestination, stringCreates a lowercased string.
str_uppercaseStringUppercasedestination, stringCreates an uppercased string.
str_to_numStringToNumberdestination, stringParses a string as a number and stores the result.

Built for the Candle ecosystem · Powered by VitePress.