System.SysUtils.TStringHelper.LastIndexOfAny

From RAD Studio API Documentation
Jump to: navigation, search

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;

Properties

Type Visibility Source Unit Parent
function public System.SysUtils.pas System.SysUtils TStringHelper

Description

Returns the last index of any character of the AnyOf character array, in the current string.

var
  MyString: String;

begin
  MyString := 'This is a string.';

  Writeln(MyString.LastIndexOfAny(['T'], 0));
end.

There are three LastIndexOfAny overloaded methods, each one allowing you to specify various options to obtain the last index of the given characters in this string.

See Also