Top "Lua" questions

Lua is a powerful, fast, lightweight, embeddable scripting language.

Split string in Lua?

I need to do a simple split of a string, but there doesn't seem to be a function for this, …

string lua
Lua string to int

How can I convert a string to an integer in Lua? I have a string like this: a = "10" I would …

lua
How to get number of entries in a Lua table?

Sounds like a "let me google it for you" question, but somehow I can't find an answer. The Lua # operator …

lua
How to check if a table contains an element in Lua?

Is there a method for checking if a table contains a value ? I have my own (naive) function, but I …

lua set unique contains lua-table
How to dump a table to console?

I'm having trouble displaying the contents of a table which contains nested tables (n-deep). I'd like to just dump it …

lua
For Loop on Lua

My assignment is how to do a for loop. I have figured it out in terms of numbers but cannot …

loops for-loop lua
List file using ls command in Linux with full path

Many will found that this is repeating questions but i have gone through all the questions before asked about this …

linux bash shell command-line lua
Check if a string isn't nil or empty in Lua

I've some currently some Lua code using the following syntax: if (foo == nil or foo == '') then foo = "some default …

string lua
How to iterate through table in Lua?

So, I have a table something along these lines: arr = { apples = { 'a', "red", 5 }, oranges = { 'o', "orange", 12 }, pears = { 'p', "green", 7 } } It …

arrays loops lua key lua-table
Why does Lua have no "continue" statement?

I have been dealing a lot with Lua in the past few months, and I really like most of the …

loops lua language-design