Answers for "lua loop through string"

Lua
17

lua for loop

-- For K,V in table
for k,v in pairs(tbl) do
 print(k)
 print(v)
end
-- For i=0, num
for i=0, num do
 print(i)  
end
Posted by: Guest on April-17-2020
0

for loop lua

for x = 0, 10, 1 do
	print(x)
end
Posted by: Guest on April-21-2021
0

lua loop through string

-- Looping through strings require gmatch.
for str in targetStr:gmatch("([^%s]+)") do
	print(str)
end

-- To learn about patterns please go to www.lua.org
Posted by: Guest on July-14-2021

Browse Popular Code Answers by Language