Sign in Join
FPDoc Onlineexperiment

TStrings.LastIndexOf function

Member of TStringspublicIn unit Classes

Return the index of the last occurrence of a string.

Declaration

pascal
function LastIndexOf(const S: string; aStart: Integer): Integer
 ; virtual
function LastIndexOf(const S: string): Integer

Description

LastIndexOf returns the index of the last occurrence of the string S. If aStart is specified, the search starts at the specified index in the list (it defaults to Count-1). If aStart is negative, it is used as an offset to Count, i.e. aCount equal to -1 will start the search at Count-1.

If aStart is larger than Count-1 it will be capped to Count-1.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.