55 posts
Posted 06 April 2015 - 09:34 PM
Is there an api or function to get the type of variable a variable is?
1140 posts
Location
Kaunas, Lithuania
Posted 06 April 2015 - 09:40 PM
There's a function called 'type'. It returns the type of the variable as a string:
print( type( "" ) ) --> string
print( type( 1 ) ) --> number
You should really use google more often, it's
way faster than asking here for these little things.
1426 posts
Location
Does anyone put something serious here?
Posted 06 April 2015 - 09:41 PM
The
type function is what you are looking for.
Edit: Ninja'd
Edited on 06 April 2015 - 07:41 PM
1220 posts
Location
Earth orbit
Posted 06 April 2015 - 09:41 PM
I believe type(variable) will return the type of variable.
EDIT: :ph34r:/> 'd
Edited on 06 April 2015 - 07:42 PM
55 posts
Posted 06 April 2015 - 10:15 PM
Uh… What is this ninja'd thing? Also thanks
MKlegoman357
7083 posts
Location
Tasmania (AU)
Posted 06 April 2015 - 10:20 PM