CountString()

Syntax

Result = CountString(String$, StringToCount$)
Description
Returns the number of occurrences of StringToCount$ found in String$.

Parameters

String$ The input string to use.
StringToCount$ The string to be counted in the input string.

Return value

The number of occurrences of 'StringToCount$' found in 'String$'.

Remarks

The counting is not word based, which means that if the 'StringToCount$' is a part of a word, it will be counted as well, as shown in the following example.

Example

  Debug CountString("How many 'ow' contains Bow ?", "ow") ; will display 3

Supported OS

All

<- Chr() - String Index - EscapeString() ->