pragma solidity ^0.4.6;
contract TestString2Bytes{
string public _name="xiaowu";
function getLength() returns(uint){
return bytes(_name).length;
}
function setFirstByteOfName(byte rep) {
//"0x4c"=L
bytes(_name)[0] = rep;
}
}
solidity学习笔记(十四)string转化bytes
最新推荐文章于 2022-11-06 17:10:20 发布