functioncount
Count the number of non-overlapping occurrences of a string
Extends from Modelica.Icons.Function (Icon for functions).
Information
Syntax
Strings.count(string, searchString)
Strings.count(string, searchString, startIndex=1,
caseSensitive=true)
Description
Returns the number of non-overlapping occurrences of string "searchString" in "string". The search is started at index "startIndex" (default = 1). If the optional argument "caseSensitive" is false, for the counting it does not matter whether a letter is upper or lower case.
It is intended for ASCII, the case-insensitive count is not guaranteed to work for UTF-8.
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| String | string | String that is analyzed | |
| String | searchString | String that is searched for in string | |
| Integer | startIndex | 1 | Start search at index startIndex |
| Boolean | caseSensitive | true | = false, if lower and upper case are ignored for count |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | result | Number of occurrences of 'searchString' in 'string' |