Before (String function)
Part of string before a substring (String class)
[Introduced in Model 204 7.5]
Before operates on a string and returns the portion of that string prior to the user-specified delimiter. To get the portion of the string after a delimiter, use the Before string method.
Syntax
%outString = string:Before( substring, [Start= number])
Syntax terms
%outString | string |
---|---|
string | string |
substring | string |
Start | number This default value of this argument is ??. |
Usage notes
Examples
The following request prints
I am the Eggman
begin
%x is string len 64 initial('I am the Eggman! I am the Walrus! Koo Koo Kachoo!')
printText {%x:before('!')}
end
The following request prints
Eggman!
begin
%x is string len 64 initial('I am the Eggman! I am the Walrus! Koo Koo Kachoo!')
printText {%x:before('!',10)}
end
See also
The Before string method.