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
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Text | String | Yes | Text to search in. | |
| Find | String | Yes | Text to count. | |
| Match case | Boolean | No | true | Count only matches with the same upper and lower case. |
| Whole word | Boolean | No | false | Count only matches that are whole words, not parts of longer words (cat in cat food, not in catalogue). |
Outputs
| Output | Type | What it is |
|---|---|---|
| count | Number | Number of times it appears; 0 when it does not. |