String.Find

Syntax

Find(Source: String; SubStr: String;[Start: Integer = 1]): Integer;

Parameters

Source. Source string.

SubStr. Search substring.

Start. Number of the string position, from which to search for search substring.

Description

The Find method returns number of the position of search substring beginning in the specified source string.

Comments

Features of method use:

Example

Sub UserProc;
Var
    s1, s2: String;
    i: Integer;
Begin
    s1 := 
"Calculator";
    s2 := 
"cul";
    
// Find search substring position in source string
    i := String.Find(s1, s2);
    Debug.WriteLine(
"Find(""" + s1 + "; " + s2 + """) = " + i.ToString);
End Sub UserProc;

After executing the example position of the cul substring in the Calculator string is displayed in the console window.

See also:

String