Operator Type:
Operator Scope of Action:
Operator Purpose:
Data Type Returned:
Operator First Added:
Operator in Current Baseline:
Operator Last Altered:
Operator Uses Regular Expressions:
Operator Has Optional Arguments:
Function [other Function type actions]
Item [operators of similar scope]
Stream parsing [other Stream parsing operators]
String [about String data type]
v9.1.0
Baseline
As at baseline
String.captureTo(matchStr, targetAttributeStr)
String.captureTo(matchStr)
Stores the source text string up to, but not including, the designated literal matchStr into the specified targetAttributeStr, a quoted name of an attribute, and returns the string that follows matchStr. Note that matchStr is not a regular expression and can only be a literal string.
If the targetAttributeStr is omitted the String is advanced to the end so processing ceases.
The value given for targetAttributeSt can be:
- a quoted literal string, e.g.
("Text")
for $Text. - an unquoted variable/loopVariable, e.g.
(vString)
for a variable 'vString'.
For example, if the stream is "Piglet, a friend of Pooh" and if wishing to capture only the name 'Piglet' into $SomeAttribute:
$Result = $Text.captureTo(", ","SomeAttribute");
Now, the value of $Result is "a friend of Pooh
" and that of $SomeAttribute is "Piglet
".
See also—notes linking to here: