We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.0 <0.9.0; pragma experimental ABIEncoderV2; contract EmptyString { function empty(string memory str) public view returns (uint256 len) { return bytes(str).length; } struct DummyBO { string str; } function emptyStruct(DummyBO memory dummy) public view returns (uint256 len) { return bytes(dummy.str).length; } }
第一步:在页面上部署智能合约 第二步:在页面上发起交易
当第一个函数的测试数据为""时,返回0,当第一个函数的测试数据为"\"\"",这种情况返回2才是跟现有的逻辑保持一致。
The text was updated successfully, but these errors were encountered:
输入""的时候,双引号被当做了参数 当前合约IDE前端对参数输入框做了非空限制,确实会影响输入空字符串的情况。
""
考虑在后续版本的参数输入框中加入“取消非空限制”的按钮,实现传入空字符串的效果
Sorry, something went wrong.
输入""的时候,双引号被当做了参数 当前合约IDE前端对参数输入框做了非空限制,确实会影响输入空字符串的情况。 考虑在后续版本的参数输入框中加入“取消非空限制”的按钮,实现传入空字符串的效果
为什么不是将""解释成空白字符串,因为"a"也是解释成a,保持一致的逻辑不是更合理吗?
"a"
a
No branches or pull requests
WeBASE版本:1.5.5
测试的智能合约:
操作步骤
第一个函数的测试数据为""时,返回2
第二个函数的测试数据为[""],返回0
期望结果
The text was updated successfully, but these errors were encountered: