Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

StringFinder

String finder functions using Forge's string cheatcodes. For internal use only.

Functions

contains

Returns whether the subject string contains the search string.

function contains(string memory subject, string memory search) internal returns (bool);

startsWith

Returns whether the subject string starts with the search string.

function startsWith(string memory subject, string memory search) internal pure returns (bool);

endsWith

Returns whether the subject string ends with the search string.

function endsWith(string memory subject, string memory search) internal pure returns (bool);

count

Returns the number of non-overlapping occurrences of the search string in the subject string.

function count(string memory subject, string memory search) internal pure returns (uint256);