From 737738a330c25dda73db7bc6ee09278a745c731f Mon Sep 17 00:00:00 2001 From: yago Date: Sat, 31 Jan 2015 16:46:30 +0100 Subject: [PATCH] Trim string function --- bot/utils.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bot/utils.lua b/bot/utils.lua index 506727b..d922a23 100644 --- a/bot/utils.lua +++ b/bot/utils.lua @@ -31,6 +31,11 @@ function string:split(sep) return fields end +-- Removes spaces +function string.trim(s) + return s:gsub("^%s*(.-)%s*$", "%1") +end + function download_to_file( url , noremove ) print("url to download: "..url) local ltn12 = require "ltn12"