System.SysUtils.TStringHelper.IndexOfAny
Delphi
function IndexOfAny(const AnyOf: array of Char): Integer; overload;
function IndexOfAny(const AnyOf: array of Char; StartIndex: Integer): Integer; overload;
function IndexOfAny(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 an integer indicating the position of the first given character found in the 0-based string.
var
MyString: String;
begin
MyString := 'This is a string.';
Writeln(MyString.IndexOfAny(['w', 's', 'a'], 0));
end.
Output:
3
If w is not found, first occurrence of s is at position 3.