- Lua Quick Start Guide
- Gabor Szauer
- 92字
- 2021-08-05 10:30:38
String coercion
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.14
message = "The rounded value of pi is: " .. pi
print(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" + 1
print (eleven)
print (7 + "01") -- 8
推薦閱讀
- OpenCV實例精解
- C語言程序設計實訓教程
- Django Design Patterns and Best Practices
- SQL Server 2012數據庫管理與開發項目教程
- 焊接機器人系統操作、編程與維護
- C語言程序設計教程
- Julia 1.0 Programming Complete Reference Guide
- 軟件測試分析與實踐
- Implementing Microsoft Dynamics NAV(Third Edition)
- Learning WordPress REST API
- 算法超簡單:趣味游戲帶你輕松入門與實踐
- VMware vRealize Orchestrator Essentials
- Alfresco for Administrators
- C#程序開發教程
- 大數據高并發Redis一本通