Data.DBXPlatform.TDBXStringList.IndexOf
Delphi
function IndexOf(const S: string): Integer; override;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.Classes.pas | Data.DBXPlatform | TDBXStringList |
Description
Returns the position of a string in the list. {{#multireplace:Data.DBXPlatform.TDBXStringList.IndexOf|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}} inherits from {{#multireplace:System.Classes.TStrings.IndexOf|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}. All content below this line refers to {{#multireplace:System.Classes.TStrings.IndexOf|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}.
Returns the position of a string in the list.
Call IndexOf to obtain the position of the first occurrence of the S string. IndexOf is not case-sensitive; this means that the given string may differ in case from the string in the list. For example:
String1 := MyStrings.Items.IndexOf('My First String');
is equivalent to
String1 := MyStrings.Items.IndexOf('My FIRST String');
IndexOf returns the 0-based index of the string. Thus, if S matches the first string in the list, IndexOf returns 0, if S is the second string, IndexOf returns 1, and so on. If the string is not in the string list, IndexOf returns -1.
Note: If the string appears in the list more than once, IndexOf returns the position of the first occurrence.