Re: splitting string
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: splitting string
- From: Jamie Webb <j@...>
- Date: Mon, 9 Aug 2004 09:21:59 +0100
On Mon, Aug 09, 2004 at 07:51:40AM +0000, Jacek Pop?awski wrote:
> What is simplest way to do it in Lua? In Python there is predefined function to
> split string, must I write one for Lua myself?
Yes. Try:
function split(str)
local r = {}
for m in string.gfind(str, "[^%s]+") do
table.insert(r, m)
end
return r
end
-- Jamie Webb