Menu
Coddy logo textTech

Strings

Part of the Fundamentals section of Coddy's Lua journey — lesson 6 of 90.

A string is a sequence of characters used to represent text in your programs.

In Lua, you can create strings by wrapping text in either single quotes or double quotes. Both work exactly the same way:

playerName = "Coddy"
gameTitle = 'Adventure Quest'
challenge icon

Challenge

Easy

Create a variable named playerName and assign it the string value Hero. Then print the value of this variable to display the character's name.

Cheat sheet

A string is a sequence of characters used to represent text. In Lua, create strings using single or double quotes:

playerName = "Coddy"
gameTitle = 'Adventure Quest'

Try it yourself

-- TODO: Write your code here
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals