Contract| Return type | vector | | Parameter key | Default value | Type | | separator | <char 10/> | path | | Water Contract<method string.split
separator=char.newline
_return_type=vector/> | |
Returns a vector of substrings found in _subject separated by
a pattern separator . If the pattern is on the very end of _subject then
the last element in the returned vector will be an additional
empty string.
_subject is a string to split up into substrings separated by the
passed-in separator . Frequently the separator string is just
a one character string of a comma, a space, a slash or a newline (which is the default).
The separator string is between the substrings in the output vector.
The separator string will not be part of any output string.
If the separator is at the beginning and/or end of the _subject string,
then there will be an empty output string and the beginning and/or end of the output vector.
"foo
bar".<split/>
 | <vector "foo" "bar"/>
|
"foo/bar/baz".<split "/"/>
 | <vector "foo" "bar" "baz"/>
|
"/foo/bar/baz/".<split "/"/>
 | <vector "" "foo" "bar" "baz" ""/>
|
"foo--bar--".<split "--"/>
 | <vector "foo" "bar" ""/>
|
"".<split/>
 | <vector/>
|
"/".<split "/"/>
 | <vector "" ""/>
|
"aaa&bbb
ccc ddd".<split separator=pattern.whitespace/>
 | <vector "aaa&bbb" "ccc" "ddd"/>
|
© Copyright 2007 Clear Methods, Inc.