How could i check a values number/letter by letter

hi i wanted to ask how could i check a values number 1 by 1, so like lets say the number is 1234 it would print “1” “2” etc, From a value in a part

loop through the string

local str = tostring(number)

for i=1, #str do
 print(str:sub(i, i))
end
1 Like

:split() is a bit more straightforward

local str = tostring(number)

for _,digit in str:split("") do
    print(digit)
end