How to convert b256 to str[66] in sway

How to convert b256 to str[66] in sway?

Unfortunately we don’t have Unicode support yet so there isn’t a general purpose solution.

That said, if all you want is ASCII or if you know how to decode in general, you can use to_le_bytes and/or to_be_bytes to transform your b256 into a byte array and go from there.

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.