Skip to content

@str

Convert a value to its string representation, or decode hex bytes as UTF-8.

Returns: string

@str(value encoding?)
Name Type Description
value any Input value
[encoding] string utf8 to decode hex bytes as a UTF-8 string
# Convert a number to string
set $s @str(42)
# Convert an address to string
set $s @str(@me)
# Decode hex bytes as UTF-8
set $s @str(0x48656c6c6f utf8)
print $s
  • @num — convert to number
  • @bytes — convert to bytes
  • @bool — convert to boolean