Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 701 Bytes

File metadata and controls

42 lines (29 loc) · 701 Bytes
title @str

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

Returns: string

Syntax

@str(value encoding?)

Arguments

Name Type Description
value any Input value
[encoding] string utf8 to decode hex bytes as a UTF-8 string

Examples

# 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

See Also

  • @num — convert to number
  • @bytes — convert to bytes
  • @bool — convert to boolean