We're starting to familiarize ourselves with several blocks of code and how they interact with each other. Let's see what happens when we add in some expressions using strings and how different they are from just regular strings that you print out in the terminal:
Create a new project folder on your desktop and name it
Working With Strings
.Make a new
main.lua
file in your text editor and save it to your folder.Type out the following lines (do not include the line numbers in the code, they are only used for line reference):
1 print("This is a string!") -- This is a string! 2 print("15" + 1) -- Returns the value 16
Add in the following variables. Notice that it uses the same variable name:
3 myVar = 28 4 print(myVar) -- Returns 28 5 myVar = "twenty-eight" 6 print(myVar) -- Returns twenty-eight
Let's add in more variables with some string values and compare them using different operators:
7 Name1, Phone = "John Doe", "123-456-7890" 8 Name2 =...