Water 5-Common Data Types-Generic Object and CollectionSplit a string by subvector keys into a vector
Contract| Return type | vector | | No input parameters. | | Parameter kind | Default value | Type | | Other unkeyed arguments | opt | | Water Contract<method string.subvectors
_other_unkeyed=opt=wob=ekind.code="_body"
_return_type=vector/> | |
See also: make_object, subvector, split, vector, length
A string may be split by specifying _other_unkeyed arguments
that are pairs of integers indicating the start and end values of various
subvectors within the string. The results are placed into a vector
of strings. If an odd number of _other_unkeyed arguments are
supplied, the last key will extend to the end of the _subject
string. For more details about subvector key pairs, see the documentation
for subvector .
Example: Extract a single subvector
"abcdefghijk".<subvectors 4 4.<plus 4 /> />
 | <v "efgh"/>
|
Example: Extracting multiple subvectors
"abcdefghijk".<subvectors 0 4 4 8 8 />
 | <v "abcd" "efgh" "ijk"/>
|
If the first key of any subvector indicator pair is greater than the
length of the _subject string, this method will throw an error.
Also, if the second key of any indicator pair is less than its
corresponding first key, this method will throw an error.
If the second key of any subvector indicator pair is greater than
the length of the _subject string, the method will return
characters from the first key to the end of the string.
© Copyright 2007 Clear Methods, Inc.