Unit 'Classes' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

TStrings.LastIndexOf

Return the index of the last occurrence of a string.

Declaration

Source position: classesh.inc line 1029

public function TStrings.LastIndexOf(

  const S: string;

  aStart: Integer

):Integer; virtual;

function TStrings.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

IndexOf

  

Find a string in the list and return its position.

IndexOfObject

  

Finds an object in the list and returns its index.


Documentation generated on: Oct 27 2024