System.SysUtils.TStringHelper.LastIndexOf
Delphi
function LastIndexOf(Value: Char): Integer; overload;
function LastIndexOf(const Value: string): Integer; overload;
function LastIndexOf(Value: Char; StartIndex: Integer): Integer; overload;
function LastIndexOf(const Value: string; StartIndex: Integer): Integer; overload;
function LastIndexOf(Value: Char; StartIndex: Integer; Count: Integer): Integer; overload;
function LastIndexOf(const Value: string; 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 la chaîne Value dans la chaîne en cours.
StartIndex spécifie le décalage dans cette chaîne où la méthode LastIndexOf commence la recherche, et Count spécifie la longueur de la sous-chaîne recherchée.
Il existe six méthodes surchargées LastIndexOf, chacune vous permettant de spécifier diverses options afin d'obtenir le dernier index de la chaîne donnée dans cette chaîne.
Lorsque l'argument Value (Char ou String), transmis à LastIndexOf, n'est pas trouvé dans la chaîne, la fonction LastIndexOf renvoie -1.