3

Is there a way to convert BuiltinString or BuiltinByteString to String ?

There are these functions in the module PlutusTx.Builtins.Class

stringToBuiltinByteString :: String -> BuiltinByteString

stringToBuiltinString :: String -> BuiltinString

Are there functions to perform the inverse operation?

1 Answer 1

2

Yes, per the definition, BuiltinByteString derives Show, so you can write show bbs, where bbs is your variable, and it will convert your BuiltinByteString into a String

1
  • Thanks for pointing this out!
    – lambda
    Commented Oct 13, 2021 at 14:07

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.