Lua: Splitting a string and getting the two numbers as separate variables
snippet in lua

Lua: Splitting a string and getting the two numbers as separate variables

user9646

str = "something123x456"
local s1, s2 = str:match("(%d+)x(%d+)")
local n1, n2 = tonumber(s1), tonumber(s2)