Strings and Text
Store and combine text values.
Strings and Text is a free Mojo Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Mojo Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Text Is a String
Any sequence of characters, like a name or a message, is a String. It is how programs hold human-readable text. 💬
Make a String
Wrap text in double quotes to create a String, then store it in a var so you can reuse the text later.
var name = "Ada"Single or Double Quotes
Mojo accepts both quote styles. Pick the one that lets your text stay clean, like single quotes around a phrase with a quote inside.
var word = 'hello'Joining Text with +
Put two Strings together using +. This is called concatenation and it builds a longer string from pieces.
var greeting = "Hi, " + nameMind the Spaces
Concatenation glues text exactly as written. Add a space inside a String so words do not collide when joined.
var full = "Ada" + " " + "Lovelace"Printing Text
print sends a String to the screen. It is your quickest way to see what a String currently holds.
print("Hello, world")Empty and Long Strings
A String can be empty ("") or hold a whole sentence. Length is up to you; the type stays the same either way.
var blank = ""Numbers Are Not Text
"42" is a String, while 42 is an Int. They look alike but behave differently, so keep text and numbers distinct.
var label = "42"Turning a Number into Text
To join a number into a message, convert it with String first so the + has two strings to combine.
var msg = "Score: " + String(score)Strings Describe Your Program
Labels, prompts, and messages are all Strings. Clear text makes your output friendly for the person reading it.
Text Powers Communication
From greetings to error messages, Strings carry meaning to users. Mastering text is half of writing useful programs.
Quick Check
You have a number in score and want to put it inside a text message. What do you do first?
Recap
A String holds text in quotes, joins with +, and prints to the screen. Convert numbers to String before mixing them in. 🎯
Frequently asked questions
Is the “Strings and Text” lesson free?
Yes — the full text of “Strings and Text” is free to read here on the web, and the Mojo Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Mojo Academy course, upgrade to CoddyKit PRO.
What will I learn in “Strings and Text”?
Store and combine text values. You practise Mojo Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Mojo Academy?
No prior experience is required. Mojo Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Strings and Text” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Mojo Academy lesson?
Yes. Every Mojo Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.