Substring.CountChar Method

function CountChar(const C: Char): Integer;

The number of occurrences of C in the window.

#NameTypeDescription
1CChar

Returns: Integer

Examples

Counting a character.

uses Substr;

procedure Example;
begin
    Assert(Substring('banana').CountChar('a') = 3);
end;