IModelling.Length

Fore Syntax

Length(Str: String): Integer;

Fore.NET Syntax

Length(Str: string): integer;

Parameters

Str. String.

Description

The Length method returns the number of characters in the specified string.

Comments

To get particular number of string characters, use the IModelling.Left and IModelling.Right methods.

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.Length("Calculator");
    Debug.WriteLine("Length(""" + "Calculator" + """" + ") = " + res.ToString);
End Sub UserProc;

After executing the example the console window displays the number of characters 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.Length("Calculator");
    System.Diagnostics.Debug.WriteLine("Length(""" + "Calculator" + """" + ") = "
        + res.ToString());
End Sub;

Example of Use in Expressions

Expression:

Length("Calculator")

Result: 10.

Expression 2:

Length("Monday")

Result: 6.

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