Searches a string for a substring.
Kernel.bdh
Strstr( in sString : string, in sSubString : string ): string;
sString starting at the first occurrence of sSubString
Parameter | Description |
---|---|
sString | Defines the string to search in |
sSubString | Defines the string to search in sString |
dcltrans transaction TStrstr var sString, sSubString, sResult: string; begin sString := "Hope the weather will be fine tomorrow!"; sSubString := "the"; write("string = "); write(sString); writeln; write("substring = "); write(sSubString); writeln; sResult := Strstr(sString, sSubString); write("result = "); write(sResult); writeln; end TStrstr;
string = Hope the weather will be fine tomorrow! substring = the result = the weather will be fine tomorrow!