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.

### Strings | Roblox Creator Documentation

https://create.roblox.com/docs/scripting/luau/strings

To convert a string to a number, use the tonumber() function. If the string doesn't have a number representation, then the tonumber() function returns nil.

### Lua String To Number With Code Examples

https://www.folkstalk.com/2022/09/lua-string-to-number-with-code-examples.html

Converting Strings You can easily convert a string to a number by using the tonumber() function. This function takes one argument (the string) and returns it as ...

### Programming in Lua : 3.4

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

Lua denotes the string concatenation operator by " .. " (two dots). If any of its operands is a number, Lua converts that number to a string.

### Convert string to integer, in Lua

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

I : Integer := Integer'Value (s); · #include <stdlib.h> · #include <stdlib.h> · (def i (Integer/parseInt s)) · (def i (Integer. s)) · #include <cstdlib>. int i = std ...

### Convert integer to string, in Lua

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

S : String := Integer'Image (I); · #include <stdlib.h>. char s[0x1000]={}; itoa(i,s,10); · (let [s (str i)]) · #include <string>. auto s = std::to_string(i);.