Ok so I am creating a realistic game and now I'm playing with car numbers. I want to make it possible for police to find vehicle if they don't know one or more letters.
For example lets say that we have 3 cars in game "RBX 999" "RLX 999" and "MLG 360" And police wants to find car, he will type "R#X 999" and he will get a list of these two cars: "RBX 999" and "RLX 999".
I want "#" to be replaced with "." so I could use it as pattern in string.gmatch()
how can I do it?
There is handy gsub function for that:
local pattern = "R#X 999" pattern = pattern:gsub( "#", "." ) -- Also known as string.gsub()