Синхронизация скриптов LUA с QUIKSharp. Внесение в ReadMe информации об ошибках core.dll / LUA скриптов
This commit is contained in:
@@ -127,7 +127,7 @@ function log(msg, level)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Doesn't work if string contains empty values, eg. 'foo,,bar'. You get {'foo','bar'} instead of {'foo', '', 'bar'}
|
||||
function split(inputstr, sep)
|
||||
if sep == nil then
|
||||
sep = "%s"
|
||||
@@ -141,6 +141,18 @@ function split(inputstr, sep)
|
||||
return t
|
||||
end
|
||||
|
||||
-- https://stackoverflow.com/questions/1426954/split-string-in-lua#comment73602874_7615129
|
||||
function split2(inputstr, sep)
|
||||
sep = sep or '%s'
|
||||
local t = {}
|
||||
for field, s in string.gmatch(inputstr, "([^"..sep.."]*)("..sep.."?)") do
|
||||
table.insert(t, field)
|
||||
if s == "" then
|
||||
return t
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function from_json(str)
|
||||
local status, msg= pcall(json.decode, str, 1, json.null) -- dkjson
|
||||
if status then
|
||||
|
||||
Reference in New Issue
Block a user