System.SysUtils.TStringHelper.CountChar

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

function CountChar(const C: Char): Integer;

Propriétés

Type Visibilité  Source Unité  Parent
function public System.SysUtils.pas System.SysUtils TStringHelper

Description

CountChar compte les occurrences du caractère C dans la chaîne.

Exemple

Le code suivant compte les lettres "s" dans la chaîne :

 const
   myString = 'Cette chaîne contient 5 occurrences de la lettre s';
 begin
   writeln(myString.CountChar('s'));
   readln;
 end.

Voir aussi