From da9377033445bd0a4c206c50bf6e93e675accf18 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 27 Mar 2025 19:56:31 +0100 Subject: [PATCH] Add strsplit lua helper --- processor/processor.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/processor/processor.go b/processor/processor.go index a2fdb56..86185c0 100644 --- a/processor/processor.go +++ b/processor/processor.go @@ -314,6 +314,18 @@ function upper(s) return string.upper(s) end function lower(s) return string.lower(s) end function format(s, ...) return string.format(s, ...) end +-- String split helper +function strsplit(inputstr, sep) + if sep == nil then + sep = "%s" + end + local t = {} + for str in string.gmatch(inputstr, "([^"..sep.."]+)") do + table.insert(t, str) + end + return t +end + -- String to number conversion helper function num(str) return tonumber(str) or 0