Find(Str: String; SubStr: String;[Start: Integer = 1]): Integer;
Find(Str: string; SubStr: string; Start: integer): integer;
Str. Source string.
SubStr. Searched substring.
Start. Number of the string position, with which search must be started.
The Find method returns position of substring start in the specified source string.
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.
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.
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;
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: