18 lines
477 B
Plaintext
18 lines
477 B
Plaintext
> (set 'str "alphabet" 'n 2 'm 4)
|
|
4
|
|
> ; starting from n characters in and of m length
|
|
> (slice str n m)
|
|
"phab"
|
|
> ; starting from n characters in, up to the end of the string
|
|
> (slice str n)
|
|
"phabet"
|
|
> ; whole string minus last character
|
|
> (chop str)
|
|
"alphabe"
|
|
> ; starting from a known character within the string and of m length
|
|
> (slice str (find "l" str) m)
|
|
"lpha"
|
|
> ; starting from a known substring within the string and of m length
|
|
> (slice str (find "ph" str) m)
|
|
"phab"
|