From c13f21c444b556b92a46ab58238a94df8e96dd0c Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Sun, 29 Aug 2021 15:41:51 +0200 Subject: [PATCH] Add text.trim_spacing --- text.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/text.lua b/text.lua index 312446f..0a8d987 100644 --- a/text.lua +++ b/text.lua @@ -57,6 +57,10 @@ end trim_right = trim_end +function trim_spacing(text) + return text:match"%s*(.-)%s*" +end + local inputstream_metatable = { __index = {read = function(self, count) local cursor = self.cursor + 1