#Built in types documentation

7 messages · Page 1 of 1 (latest)

spring osprey
#

It would be nice if there is a documentation for the soroban built-in types and their methods.

This way developers can know what method they can and can't access

lean barn
spring osprey
#

Do you know how to join two strings together

frank idol
#

you currently need to convert to bytes and manipulate them

spring osprey
#

Alright. Could you send me a code snippet if you have done so already

frank idol
#

I generally don't work with strings in contracts so haven't done it already, but you can check #🔹|developer-chat message. It's not the same thing as joining strings but it shows the conversion from a string to bytes, then it's really just about concatenating the bytes and converting the back to a str (from_utf8) and then str to string via String::from_slice.

pale finch
#

yeah, I just wanted to say that string support definitely can be improved, BUT chances are you don't actually want to deal with strings. unless you're building custom messaging protocols (e.g. a bridge), you should be able to do pretty much anything with the contracttypes