System.SysUtils.TStringHelper.CountChar
Delphi
function CountChar(const C: Char): Integer;
Contents
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.SysUtils.pas | System.SysUtils | TStringHelper |
Description
CountChar counts the occurrences of the C character in the string.
Example
The following code counts the "s" letters in the string:
const
myString = 'This string contains 5 occurrences of s';
begin
writeln(myString.CountChar('s'));
readln;
end.