IModelling.Contains

Fore Syntax

Contains(Str: String; SubStr: String): Boolean;

Fore.NET Syntax

Contains(Str: string; SubStr: string): boolean;

Parameters

Str. Source string.

SubStr. Searched substring.

Description

The Contains method returns whether a source string contains a searched substring.

Comments

Substring search in the source string is case-sensitive.

Fore Example

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

Sub UserProc;
Var
    Func: Modelling;
    res: Boolean;
Begin
    Func := New Modelling.Create;
    res := Func.Contains("Calculator""Calc");
    Debug.WriteLine("Contains(""" + "Calculator" + """, """ + "Calc""" + ") = " + res.ToString);
End Sub UserProc;

After executing the example the console window displays whether the Calc string is contained 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: Boolean;
Begin
    Func := New Modelling.Create();
    res := Func.Contains("Calculator""Calc");
    System.Diagnostics.Debug.WriteLine("Contains(""" + "Calculator" + """, """
        + "Calc""" + ") = " + res.ToString());
End Sub;

Example of Use in Expressions

Expression:

Contains("Calculator", "Cal")

Result: True.

Expression 2:

Contains("Calculator", "cal")

Result: False

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