Use the tonumber function. As in a = tonumber("10").

### Lua string to int - Stack Overflow

https://stackoverflow.com/questions/10962085/lua-string-to-int

Lua just does automatically conversion between strings and numbers. If you want ensure the type, use a = tonumber(a). – xpol. Feb 26, 2016 at 3:52.

### Programming in Lua : 2.4

https://www.lua.org/pil/2.4.html

Strings have the usual meaning: a sequence of characters. ... Any numeric operation applied to a string tries to convert the string to a number:

### Converting Strings

https://developer.roblox.com/en-us/articles/String

Math and Strings. When you perform math using a string value, Lua will automatically try to convert the string into a number, so you don't need to ...

### Convert string to integer, in Lua

https://programming-idioms.org/idiom/22/convert-string-to-integer/1301/lua

Idiom #22 Convert string to integer · I : Integer := Integer'Value (s); · int i = atoi(s); · i = (int)strtol(s, (char **)NULL, 10); · (def i (Integer/parseInt s)).

### Convert a string to upper or lower case - iNTERFACEWARE Help ...

https://help.interfaceware.com/code/details/convert-a-string-to-upper-or-lower-case

Results 1 - 20 of 79 ... convert a string to upper case local s = 'hello world' s = s:upper() --> 'HELLO... ... stringutil.lua - see the capitalize() function

### Convert integer to string, in Lua

https://programming-idioms.org/idiom/55/convert-integer-to-string/1315/lua

Idiom #55 Convert integer to string · S : String := Integer'Image (I); · char s[0x1000]={}; itoa(i,s,10); · (let [s (str i)]) · auto s = std::to_string(i); · string ...