lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>I could not find a function to split a string into a table

Probably because there are many ways to split a string. The workhorse will be
gsub. Here is an example from the reference manual:

t = {n=0}
gsub("first second word", "(%w+)", function (w) tinsert(%t, w) end)
--> t={"first", "second", "word"; n=3}

--lhf