IModelling.Find

Fore Syntax

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

Fore.NET Syntax

Find(Str: string; SubStr: string; Start: integer): integer;

Parameters

Str. Source string.

SubStr. Searched substring.

Start. Number of the string position, with which search must be started.

Description

The Find method returns position of substring start in the specified source string.

Comments

If the specified substring is not found in the source string, the method returns 0.

Search is case-sensitive.

Character numbering in the string starts with 1.

Fore Example

To execute the example, add a link to the Ms system assembly.

Sub UserProc;
Var
    Func: Modelling;
    res: integer;
Begin
    Func := New Modelling.Create;
    res := Func.Find("Calculator""cul");
    Debug.WriteLine("Find(""" + "Calculator" + """, """ + "cul""" + ") = " + res.ToString);
End Sub UserProc;

After executing the example the console window displays position of the "cul" string in the Calculator string.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Ms;

Public Shared Sub Main(Params: StartParams);
Var
    Func: IModelling;
    res: integer;
Begin
    Func := New Modelling.Create();
    res := Func.Find("Calculator""cul"1);
    System.Diagnostics.Debug.WriteLine("Find(""" + "Calculator"
        + """, """ + "cul""" + ") = " + res.ToString());
End Sub;

Example of Use in Expressions

Expression:

Find("Calculator", "a", 4)

Result: 7

Expression 2:

Find("Calculator", "a")

Result: 2

Use: expressions can be used in model formulas of modeling container, in formulas of time series database calculated series, in formulas of the modeling container that is a child one for time series database in formula editor.

See also:

IModelling | Time Series Database: Calculator| Modeling Container: Editing Regressor or Formula | Expression Editor

See also:

IModelling