Logo

Programming-Idioms

History of Idiom 38 > diff from v45 to v46

Edit summary for version 46 by Dirk:
New Lisp implementation by user [Dirk]

Version 45

2018-03-10, 23:49:40

Version 46

2019-09-26, 16:48:52

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Illustration

Idiom #38 Extract a substring

Find substring t consisting in characters i (included) to j (excluded) of string s.
(character indexes start at 0 unless specified otherwise)

Illustration
Code
(subseq s i j)  ; Extract the part between i/j as described
(subseq s i)    ; Extract the part starting at i to the end of s
Comments bubble
t is not a good choice for a variable name in Lisp, so using s instead for the string
Doc URL
http://www.lispworks.com/documentation/lw70/CLHS/Body/f_subseq.htm#subseq