IStringList.Contains

Syntax

Contains(Value: String): Boolean;

Parameters

Value. Value, which existence should be checked.

Description

The Contains method checks if there is an element with the specified value.

Comments

The method returns True if there is an element with the specified value, and False if the element is missing.

Example

Sub UserProc;
Var
    StrL: IStringList;
    i: Integer;
    s: String;
Begin
    StrL := New StringList.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        StrL.Add("Number " + Math.RandBetweenI(0100).ToString);
    End For;
    If StrL.Contains("Number 25"Then
        s := "Yes";
    Else
        s := "No";
    End If;
End Sub UserProc;

After executing the example a dynamic array of strings is created. The "s" variable is set to Yes, if the array contains an element with the Number 25 value.

See also:

IStringList