Commit: 5663826b24c12d4877fdcf4f6ae91eaeb20552b4 Parent: d5bcc2dd5962c8d94ffbf02b8e570f73e313f131 Author: Ren Tatsumoto Date: Wed, 26 Aug 2020 09:36:20 +0300 functions for removing spaces Diffstat:
| M | subs2srs.lua | | | 8 | ++++++++ |
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/subs2srs.lua b/subs2srs.lua @@ -108,6 +108,14 @@ local function remove_newlines(str) return str:gsub('[\n\r]+',' ') end +local function remove_leading_trailing_spaces(str) + return str:gsub('^%s*(.-)%s*$', '%1') +end + +local function remove_all_spaces(str) + return str:gsub('%s*', '') +end + local function escape_apostrophes(str) return str:gsub("'", "'") end