Byte Operators

TEAL byte slices are similar to strings and can be manipulated in much the same way.

Concat

Byte slices can be combined using the Concat expression. This expression takes at least two arguments and produces a new byte slice consisting of each argument, one after another. For example:

Concat(Bytes("a"), Bytes("b"), Bytes("c")) # equivalent to Bytes("abc")

Substring

Byte slices can be extracted from other byte slices using the Substring expression. This expression can extract part of a byte slicing given start and end indices. For example:

Substring(Bytes("algorand"), Int(0), Int(4)) # equivalent to Bytes("algo")