- 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
推薦閱讀
- OpenStack Cloud Computing Cookbook(Third Edition)
- 極簡算法史:從數學到機器的故事
- iOS面試一戰到底
- Apache Oozie Essentials
- 薛定宇教授大講堂(卷Ⅳ):MATLAB最優化計算
- Visual Basic程序設計教程
- Learn Scala Programming
- Learning Laravel 4 Application Development
- 快速念咒:MySQL入門指南與進階實戰
- Learning PHP 7
- INSTANT Silverlight 5 Animation
- Unity 2018 Augmented Reality Projects
- R語言數據可視化:科技圖表繪制
- Java并發編程之美
- 單片機原理及應用技術