(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 ",") ".")))