Skip to main content

Count occurrences

Count how many times a piece of text appears in a text (matches do not overlap).

Command in the String toolkit · id ooa.string/count_occurrences · 4 inputs (2 required), 1 output

Inputs​

InputTypeRequiredDefaultWhat it is
TextStringYesText to search in.
FindStringYesText to count.
Match caseBooleanNotrueCount only matches with the same upper and lower case.
Whole wordBooleanNofalseCount only matches that are whole words, not parts of longer words (cat in cat food, not in catalogue).

Outputs​

OutputTypeWhat it is
countNumberNumber of times it appears; 0 when it does not.