From 44fd5416a9a110a12f8b3f2d369e5638055b306e Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 29 Oct 2024 21:06:49 +0300 Subject: [PATCH] fix string.replace --- res/scripts/stdlib.lua | 4 +++- res/scripts/stdmin.lua | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index 8fbc779f..2dcb91ed 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -9,7 +9,9 @@ function sleep(timesec) end end --- events +------------------------------------------------ +------------------- Events --------------------- +------------------------------------------------ events = { handlers = {} } diff --git a/res/scripts/stdmin.lua b/res/scripts/stdmin.lua index 9a955fff..ec3b1fec 100644 --- a/res/scripts/stdmin.lua +++ b/res/scripts/stdmin.lua @@ -109,7 +109,8 @@ function string.explode(separator, str, withpattern) local current_pos = 1 for i = 1, string_len(str) do - local start_pos, end_pos = string_find(str, separator, current_pos, not withpattern) + local start_pos, end_pos = string_find( + str, separator, current_pos, not withpattern) if (not start_pos) then break end ret[i] = string_sub(str, current_pos, start_pos - 1) current_pos = end_pos + 1 @@ -139,7 +140,7 @@ function string.formatted_time(seconds, format) end function string.replace(str, tofind, toreplace) - local tbl = string.Explode(tofind, str) + local tbl = string.explode(tofind, str) if (tbl[1]) then return table.concat(tbl, toreplace) end return str end