July 2018
Beginner
202 pages
5h 42m
English
String coercion is a fancy way of asking Lua to automatically convert data types to string representations of the data. For example, a string and an integer can be combined to form a new string like the following:
pi = 3.14message = "The rounded value of pi is: " .. piprint(message)print("Nine: " .. 9)
String coercion also works the other way around! Adding a string that contains only numbers to a number is valid addition:
eleven = "10" + 1print (eleven)print (7 + "01") -- 8