Water 5-Common Data Types-Generic Object and Collection
method last
Contract
Return typewob
Parameter keyDefault valueType
index_from_end0integer
returns"first"string
Water Contract
<method last
  index_from_end=0=number.integer
  returns       ="first"=string/>
_subject is expected to be a java vector, a supervector, or a string. If it is not, error. If the _subject has zero size, error. Otherwise, With no argument passed, it returns the last element of _subject With an argument of 1 it returns the 2nd to the last element. With an argument of 2 it returns the 3nd to the last element, etc. The default value for the first argument is 0 meaning return the last element. If the "returns" argument is "all", then the subvector of all the items starting with the indicated item through the end of the vector are returned. The default value for "returns" is "first" meaning just return the one item indicated by the first argument. Out of range value of index_from_end causes an error.
<vector 100 200 300/>.<last/>300
<vector 100 200 300/>.<last 1/>
200
"abcdef".<last 2 returns="all"/>
"def"