Project

General

Profile

$countcs » History » Version 5

Per Amundsen, 02/16/2023 09:20 PM

1 1 Per Amundsen
_Added in 1.8.10_
2
3
*$countcs(string,substring,substring2,...,substringN)*
4
5
Returns the number of times substring occurs in string.
6
7 2 Per Amundsen
_[[$countcs]] is case-sensitive, see [[$count]] for case-insensitive version._
8 1 Per Amundsen
9
*Parameters*
10
11 5 Per Amundsen
table(ktable).
12
|*Parameter*|*Description*|
13
| string | The string to search for. |
14
| substring,substring2,...,substringN | Substrings to search. |
15 1 Per Amundsen
16
*Example*
17
18
<pre>
19 4 Per Amundsen
; Count number of times 'A' appears in 'Aaa'.
20 2 Per Amundsen
//echo -ag $countcs(Aaa,A)
21 1 Per Amundsen
22 4 Per Amundsen
; Count number of times 'a' appears in 'Aaa'.
23 2 Per Amundsen
//echo -ag $countcs(Aaa,a)
24 1 Per Amundsen
</pre>