23 lines
486 B
Plaintext
23 lines
486 B
Plaintext
s <- "abcdefgh"
|
|
s.0
|
|
=> "a"
|
|
|
|
# starting from n characters in and of m length;
|
|
def (substr s start len)
|
|
(s start start+len)
|
|
(substr s 3 2)
|
|
=> "de"
|
|
|
|
# starting from n characters in, up to the end of the string
|
|
(s 3 nil)
|
|
=> "defgh"
|
|
|
|
# whole string minus last character;
|
|
(s 3 -1)
|
|
=> "defg"
|
|
|
|
# starting from a known character within the string and of <tt>m</tt> length;
|
|
# starting from a known substring within the string and of <tt>m</tt> length.
|
|
let start (pos s pat)
|
|
(s start start+m)
|