From 9b82db238f9e2e02a76f95c793f8d6ef2387ecfd Mon Sep 17 00:00:00 2001 From: unwox Date: Thu, 26 Sep 2024 17:46:38 +0600 Subject: init --- lib/string.fnl | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lib/string.fnl (limited to 'lib/string.fnl') diff --git a/lib/string.fnl b/lib/string.fnl new file mode 100644 index 0000000..466dac9 --- /dev/null +++ b/lib/string.fnl @@ -0,0 +1,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} -- cgit v1.2.3