Package: split-sequence
Function split-sequence
Lambda Listsplit-sequence (delimiter sequence &key start end from-end count remove-empty-subseqs test test-not key) ArgumentsReturn ValueReturns a proper list list and an index into the sequence. Details Return a list of subsequences in sequence delimited by delimiter. list is a list of sequences of the same kind as sequence that has elements consisting of subsequences of sequence that were delimited in the argument by elements satisfying the test. index is an index into sequence indicating the unprocessed region, suitable as an argument to subseq to continue processing in the same manner if desired. The count argument, if supplied, limits the number of subsequences in the first return value; if more than count delimited subsequences exist in sequence, the count leftmost delimited subsequences will be in order in the first return value, and the second return value will be the index into sequence at which processing stopped. If from-end is non-null, sequence is conceptually processed from right to left, accumulating the subsequences in reverse order; from-end only makes a difference in the case of a non-null count argument. In the presence of from-end, the count rightmost delimited subsequences will be in the order that they are in sequence in the first return value, and the second is the index indicating the end of the unprocessed region. The start and end keyword arguments permit a certain subsequence of the sequence to be processed without the need for a copying stage; their use is conceptually equivalent to partitioning the subsequence delimited by start and end, only without the need for copying. If remove-empty-subseqs is null (the default), then empty subsequences will be included in the result. In all cases, the subsequences in the first return value will be in the order that they appeared in sequence. ExamplesSPLIT-SEQUENCE> (split-sequence #Space "A stitch in time saves nine.") ⇒ ("A" "stitch" "in" "time" "saves" "nine.") ⇒ 28 | See also |
2012-12-29