System.SysUtils.TStringHelper.IndexOfAny
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.