Chapter     5

Strings

Hopefully you survived the previous chapter, on Lua math. The whole idea of these first few chapters is to introduce you to the fact that you can create your logic in Lua and then use any framework to add the graphics. So, many of the functions that we shall create in these chapters can be used universally across most of the frameworks without many changes. In this chapter we shall explore the topic of strings.

What Is a String?

A string is one of the many variable types available in Lua. It can hold alphanumeric characters of arbitrary lengths. It cannot have multiple dimensions like a table can. Lua automatically converts strings into numbers if the strings are used in any form of arithmetic operation. This process is ...

Get Learn Lua for iOS Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.