solidity 中字符串怎么相加

solidity 中有没有 类似 str1 + str2 这样的方法

请先 登录 后评论

最佳答案 2021-11-21 16:06

pragma solidity >=0.7.1;

contract C {
    function concatenate(string memory s1, string memory s2) public pure returns (string memory) {
        return string(abi.encodePacked(s1, s2));
    }
}
请先 登录 后评论

其它 0 个回答

  • 1 关注
  • 0 收藏,2122 浏览
  • ANYFC 提出于 2021-11-21 14:37

相似问题