2

Let's say I have a bytes array as such:

Bytes[4] = b"\x00"

How would I convert this to a string?

1 Answer 1

2

Vyper has a convert method which works as a sort of type cast.

myBytes: Bytes[4] = b"\x00"
myString: String[4] = convert(myBytes, String[4])

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.