StartsWith(Str: String; SubStr: String): Boolean;
StartsWith(Str: string; SubStr: string): boolean;
Str. Source string.
SubStr. Searched substring.
The StartsWith method returns whether a source string starts with the searched substring.
Available values:
True. A source string starts from the searched substring.
False. A source string does not start from the searched substring.
Spaces at the beginning of the string and substring are ignored. Substring search in the source string is case-sensitive.
To get whether a source string starts from the searched substring, use the IModelling.EndsWith method.
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.StartsWith("Calculator", "Calc");
Debug.WriteLine("EndsWith(""" + "Calculator" + """, """ + "Calc""" + ") = " + res.ToString);
End Sub UserProc;
After executing the example the console window displays whether the Calculator string starts from the Calc string.
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.StartsWith("Calculator", "Calc");
System.Diagnostics.Debug.WriteLine("StartsWith(""" + "Calculator"
+ """, """ + "Calc""" + ") = " + res.ToString());
End Sub;
Expression:
StartsWith("Calculator", "calc")
Result: False.
Expression 2:
StartsWith("Calculator", " Calc")
Result: True.
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: