From de2152e313cc120728ca443146f36a85963a24df Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 7 Dec 2021 17:29:00 -0800 Subject: new primitive: string split --- advent.tlv | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/advent.tlv b/advent.tlv index a1652ac..afbff19 100644 --- a/advent.tlv +++ b/advent.tlv @@ -128,6 +128,19 @@ function filter(l, f) end return result end +]==], + }, + { + __teliva_timestamp = [==[ +original]==], + split = [==[ +function split(s, d) + result = {} + for match in (s..d):gmatch("(.-)"..d) do + table.insert(result, match); + end + return result +end ]==], }, { -- cgit 1.4.1-2-gfad0