summaryrefslogtreecommitdiff
path: root/lib/string.fnl
blob: 466dac9b0c25652666ab37b71875f5b96def7083 (plain)
1
2
3
4
5
6
7
8
9
10
11
(fn split [string]
  (accumulate [res [] v _
               (string:gmatch "%S+")]
    (do
      (table.insert res v)
      res)))

(fn ends-with [string end]
  (= (string.sub string (- (# end))) end))

{: split : ends-with}