--- title: "count-substring()" slug: "string-count-substring" updated: 2026-08-17T05:43:01Z published: 2026-08-17T05:43:01Z canonical: "docs.lobstersoftware.com/string-count-substring" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # count-substring() This function returns the number of occurrences of search text **b** in text **a**. ## Parameters | Parameter | Description | | --- | --- | | a | Text | | b | Search text | ## Examples | Parameter a | Parameter b | Result | | --- | --- | --- | | abcdecfgc | c | 3 | | abcdecfgc | abc | 1 | | abcdecfgc | x | 0 |