$count » History » Version 2
Per Amundsen, 08/12/2015 09:36 AM
| 1 | 1 | Per Amundsen | _Added in 1.8.10_ |
|---|---|---|---|
| 2 | |||
| 3 | *$count(string,substring,substring2,...,substringN)* |
||
| 4 | |||
| 5 | Returns the number of times substring occurs in string. |
||
| 6 | |||
| 7 | 2 | Per Amundsen | _[[$count]] is case-insensitive, see [[$countcs]] for case-sensitive version._ |
| 8 | 1 | Per Amundsen | |
| 9 | *Parameters* |
||
| 10 | |||
| 11 | string - The string to search for. |
||
| 12 | substring,substring2,...,substringN - Substrings to search. |
||
| 13 | |||
| 14 | *Example* |
||
| 15 | |||
| 16 | <pre> |
||
| 17 | 2 | Per Amundsen | ; returns 1 |
| 18 | 1 | Per Amundsen | //echo -ag $count(hello,el) |
| 19 | |||
| 20 | 2 | Per Amundsen | ; returns 2 |
| 21 | 1 | Per Amundsen | //echo -ag $count(hello,l) |
| 22 | </pre> |