The code snippet I have included Converts an ASCII string value into an uint
as long as the string itself is a valid unsigned integer and I am getting errors on line "assert(uint8(_bytesValue[i]) >= 48 && uint8(_bytesValue[i]) <= 57);" and on line "_ret += (uint8(_bytesValue[i]) - 48)*j;" as given in the screenshot of the code.
function parseInt(string memory _value)
public
returns (uint _ret) {
bytes memory _bytesValue = bytes(_value);
uint j = 1;
for(uint i = _bytesValue.length-1; i >= 0 && i < _bytesValue.length; i--)
{
assert(uint8(_bytesValue[i]) >= 48 && uint8(_bytesValue[i]) <= 57);
_ret += (uint8(_bytesValue[i]) - 48)*j;
j*=10;
}
}