Skip to content

Feature request: input.index(key) #7487

@smol-ninja

Description

@smol-ninja

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions