I have a function that is called with some data - "SOMETHING".
function checker(address _from, uint _value, bytes calldata _data) external{
//HOW to check if _data contains "SOMETHING"?
}
I have already tried:
if(string(_data) == ("SOMETHING")){...};
if(string(_data) == ("0x534f4d455448494e470a")){...}; // SOMETHING in hex
if(_data == 0x534f4d455448494e470a){...}
if(_data == hex"SOMETHING"){...}
if(_data == hex"534f4d455448494e470a"){...}
but it always says
Operator == not compatible with types string calldata and literal_string
in some form or the other...
How can I compare the calldata with a String value? How to convert calldata to String correctly? How to check if the calldata contains some String value?