{ compter les occurences d'une chaines dans une autre }
function CountString(const S, StrToCount : string) : integer;
var N : integer;
begin
result := 0;
N := Posex(StrToCount,S,1);
while N <> 0 do begin
inc(result);
N := Posex(StrToCount,S,N+Length(StrToCount));
end;
end;
{ compter les occurences d'un caractere dans une chaine }
function CountChar(const S : string; const CharToCount : char) : integer;
var N : integer;
begin
result := 0;
N := Posex(CharToCount,S,1);
while N <> 0 do begin
inc(result);
N := Posex(CharToCount,S,N+1);
end;
end;
I := CountString('Blablabla bla blabla', 'la');
renvois : 6