# SubStringCount - script and chart function

SubstringCount() returns the number of occurrences of the specified substring in the input string text. If there is no match, 0 is returned.

Syntax:

SubStringCount(text, sub\_string)

Return data type: integer

Arguments:

SubStringCount arguments

| Argument | Description |
| --- | --- |
| text | The original string. |
| sub\_string | A string which<br>may occur one or more times within the input string text. |

Examples and results:

Examples and results

| Example | Result |
| --- | --- |
| `SubStringCount<br>( 'abcdefgcdxyz', 'cd' )` | Returns '2' |
| `SubStringCount<br>( 'abcdefgcdxyz', 'dc' )` | Returns '0' |