Question : solidity string comparison
Answered by : oliver-li
function isSolidity(string memory _language) public { // Compare string keccak256 hashes to check equality if (keccak256(abi.encodePacked('Solidity')) == keccak256(abi.encodePacked(_language))) { // do something here... }
}
Source : https://soliditytips.com/articles/compare-strings-solidity/ | Last Update : Thu, 03 Mar 22