8 lines
262 B
Fennel
8 lines
262 B
Fennel
(fn string.split [self sep]
|
|
(let [pattern (string.format "([^%s]+)" sep)
|
|
fields {}]
|
|
(self:gsub pattern (fn [c] (tset fields (+ 1 (length fields)) c)))
|
|
fields))
|
|
|
|
(let [str "Hello,How,Are,You,Today"]
|
|
(print (table.concat (str:split ",") ".")))
|