x = io.read()is a number or a word
Detect if input is number or name
Started by tfoote, Jul 06 2012 10:31 PM
1 reply to this topic
#1
Posted 06 July 2012 - 10:31 PM
Can you detect if an input such as
#2
Posted 06 July 2012 - 10:33 PM
You can detect if it's a number or not like this:
local input = read() -- get the input, doesn't really matter how if tonumber(input) ~= nil then -- the input is a number else -- the input is a word end
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











