Hello Everyone!
My Name Is Nehoray
How can I Convert String Into Number?
Thanks.
Hello Everyone!
My Name Is Nehoray
How can I Convert String Into Number?
Thanks.
You can use the tonumber function to convert strings to numbers.
String to number, or string to value…? Strings are values too.
To answer the title, just use tonumber
.
print(tonumber("5") == 5) -- true
print(tonumber("five")) -- tonumber returns nil if it cant convert to number