【发布时间】:2021-08-28 14:24:53
【问题描述】:
我用于连接 2 个字符串的代码非常简单:
string baseUrl = "http://localhost:8080/";
string url = baseUrl.append(url_secret);
但我有一个错误:
Error: Different number of components on the left hand side (1) than on the right hand side (0).
--> test.sol:156:9:
|
156 | string url = baseUrl.append(url_secret);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
怎么了?
【问题讨论】:
-
建议使用
string(abi.encodePacked(a, b))连接两个字符串以提高gas 成本。 -
错误:不支持的函数调用
标签: solidity smartcontracts ton