Water 5-Common Data Types-Generic Object and Collection
method string.subvectors
Split a string by subvector keys into a vector
Contract
Return typevector
No input parameters.
Parameter kindDefault valueType
Other unkeyed argumentsopt
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.