System.SysUtils.TStringHelper.LastIndexOfAny
Delphi
function LastIndexOfAny(const AnyOf: array of Char): Integer; overload;
function LastIndexOfAny(const AnyOf: array of Char; StartIndex: Integer): Integer; overload;
function LastIndexOfAny(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 le dernier index de n'importe quel caractère du tableau de caractères AnyOf
, dans la chaîne en cours.
var
MyString: String;
begin
MyString := 'This is a string.';
Writeln(MyString.LastIndexOfAny(['T'], 0));
end.
Il existe trois méthodes surchargées LastIndexOfAny, chacune vous permettant de spécifier diverses options afin d'obtenir le dernier index des caractères donnés dans cette chaîne.