How to operate String

How to operate String, such as do ‘add’, storage
my simple code is below:


abi StoreString {
fn name() → String;

use std::string::String;

configurable {
word1: str[8] = __to_str_array(“MyAsset1”),
word2: str[7] = __to_str_array(“MyAsset”),

impl StoreString for Contract {
fn name() → String {

if I want to add word1 and word2 then return, what should I do?
If I want to storage String, then return, what should I do?

Hey @william, is this what you are looking for How to concatenate strings in Sway??

Thank You, It can work

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