The 'subseq' function extracts a substring from 'string' starting with the 'start' offset and ending with the 'end' offset. The 'start' offset has a origin or 0. The substring is returned.
(subseq "12345678" 0) ; returns "12345678" (subseq "12345678" 2) ; returns "345678" (subseq "12345678" 2 4) ; returns "34" (subseq "1234" 3) ; returns "4" (subseq "1234" 4) ; returns "" (subseq "1234" 4 2) ; returns "" (subseq "1234" 5) ; error: string index out of bounds - 5
Common Lisp: The 'subseq' function in Common Lisp is intended to return a portion of a sequence, a sub-sequence. This function operates on lists and vectors [one-dimensional arrays of data], basically ordered data. Strings are just one of the valid types operated on by 'subseq' in Common Lisp. The XLISP 'subseq' function only operates on strings.
See the
subseq
function in the