[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: (newbie) Lua equivalent of split() in perl?
- From: Gregory Benjamin <gregb@...>
- Date: Fri, 7 Oct 2005 21:50:57 -0700 (PDT)
How does one do the equivalent of
the following Perl code:
($name,$birthyear,$sex) = split();
when presented with a line of input text like:
"jane 2000 f"
which results in $name = "jane", $birthyear = 2000, $sex = "f"
in Lua 5.0?
I'm learning Lua with the aim to use it as a stand-alone
scripting language. I don't have any plans to embed it in anything
at the moment and want to avoid linking in C code if possible.