So I have this table at first it has things I want but then it has something I dont want when it reaches the something I dont want i want it to stop the loop but im unsure how
this is what the table has in it.
"The#",
"And#",
"Fudge#",
"Something I don't want",
--I want to break the loop after its found the "something I don't want". but I do not know-how
"No#",
"Thank#",
"You#"
This is what I want it to return
"The#",
"And#",
"Fudge#",
here is my code
local Table = {
"The#",
"And#",
"Fudge#",
"Smething I dont want",
--I want to break the loop after its found the "something I dont want". but I do no know how
"No#",
"Thank#",
"You#"
}
--My attempt
for Number, String in pairs(Table) do
if string.find(String, "#") then
if not string.find(String, "#") then
break
end
end
end
--failed
for i = 1, #Table do
print(Table[i])
end
please could someone help?