hello guys this is my code and i want to reverse a string with solidity :
function reverseValue(string _base) internal returns(string){
bytes memory _baseBytes = bytes(_base);
string memory _tempValue = new string(_baseBytes.length);
bytes memory _newValue = bytes(_tempValue);
for(uint i=_baseBytes.length;i<=0;i--){
_newValue[_baseBytes.length - i] = _baseBytes[i];
}
return string(_newValue);
}
but the only result is this code below :
0:string : \u0000\u0000\u0000\u0000\u0000\u0000
i think i wrote my code right but i cant find the problem ... tnx to help me :)