1
我正在將lua移植到chaiscript。原來的Lua代碼使用split
:chaiscript字符串可以像lua一樣分裂嗎?
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find(self, delimiter, from )
while delim_from do
table.insert(result, string.sub(self, from , delim_from-1))
from = delim_to + 1
delim_from, delim_to = string.find(self, delimiter, from )
end
table.insert(result, string.sub(self, from ))
return result
end
但我找不到split
chaiscript的版本...是否chaiscript有split
功能?