Vm.sol offers string manipulation functions that come in very handy when dealing with strings. In the latest versions of forge-std, the introduction of new functions such as replace has lowered our dependency on other external libraries.
However, forge-std still lacks one useful function for which foundry users may have to rely on external dependencies - a function that can return the index of the first occurrence of a key in an input string.
function index(string memory input, string memory key) external pure returns (uint256);
It would, therefore, be very useful if we could add support to it.
Vm.soloffers string manipulation functions that come in very handy when dealing with strings. In the latest versions offorge-std, the introduction of new functions such asreplacehas lowered our dependency on other external libraries.However,
forge-stdstill lacks one useful function for which foundry users may have to rely on external dependencies - a function that can return the index of the first occurrence of a key in an input string.It would, therefore, be very useful if we could add support to it.