slight help
I am new to lua also. I did come across a function that may help you split the string into two table entries.
function split(str)
local ret = {}
for w in string.gmatch(str, "[%w,._]+") do
table.insert(ret, w)
end
return ret
end
The %w refers to non-characters, such as numbers etc.
You can put any character you want between [] including the dash.
So if you are splitting the name based on a dash you would use:
string.gmatch(str, "[-]+")
The plus at the end of the brackets allows for handling multiple dashes in a row.