Using the in statement #1314
Answered
by
SquidDev
stacode123
asked this question in
Q&A
-
IF i have a string a ="a" and a string b= "ab" can i use |
Beta Was this translation helpful? Give feedback.
Answered by
SquidDev
Jan 26, 2023
Replies: 1 comment 1 reply
-
No - the If you want to check if one string is in another, you can use Lua patterns and local a = "a"
local b = "ab"
if b:find(a, 1, true) then
-- something
end |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
stacode123
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No - the
in
keyword is only used for looping over things (for k, v in pairs(some_table) do ... end
).If you want to check if one string is in another, you can use Lua patterns and
string.find
: