Ranking
Original Post
Lua String parsing
I'm new to lua and I need to parse a string. Say tParams = "231HYPHEN1".
I want to parse it so 231 is assigned to one variable and 1 is assigned to another. HYPHEN is inconsequential.

Thanks for any help.
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.