I have an if-statement where I want to test if x is equal to a string. The string however can be anything beginning with "m9k_" (meaning "m9k_gun1" would return true as well as "m9k_horsefarts")
How would I do that?
Any help is appreciated :D
[code]
if my_string:match("^m9k_") then
...
end
[/code]
[url]http://www.lua.org/pil/20.2.html[/url]
Alternatively use find instead of match with the same input.
[QUOTE=Willox;47237937][code]
if my_string:match("^m9k_") then
...
end
[/code]
[url]http://www.lua.org/pil/20.2.html[/url]
Alternatively use find instead of match with the same input.[/QUOTE]
Thanks! :D
Sorry, you need to Log In to post a reply to this thread.