System.SysUtils.TStringHelper.IndexOfAny

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

function IndexOfAny(const AnyOf: array of Char): Integer; overload;
function IndexOfAny(const AnyOf: array of Char; StartIndex: Integer): Integer; overload;
function IndexOfAny(const AnyOf: array of Char; StartIndex: Integer; Count: Integer): Integer; overload;

Propriétés

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

Description

Renvoie un entier indiquant la position du premier caractère donné trouvé dans la chaîne de base zéro.

 var
   MyString: String;
 
 begin
   MyString := 'This is a string.';
 
   Writeln(MyString.IndexOfAny(['w', 's', 'a'], 0));
 end.

Sortie :

 3

w n'est pas trouvé, la première occurrence de s est à la position 3.

Voir aussi