</>Learn to Write Code
LearnPseudocodeReal CodeLanguagesVideosCode TalkAbout
Learn → Programming Fundamentals → Strings & Text

Programming Fundamentals

01Variables02Operators03Input & Output04Sequence05Conditions06Loops07Functions08Objects09Lists10Strings11Errors12Recursion13Inheritance
Lesson 10 of 13·Beginner

Strings & Text

Build a longer message out of smaller pieces of text, and measure how much text you have.

Related:stringtextconcatenationjoinlength

Text is data you can build and measure

A string is just text: a name, a sentence, a whole paragraph. Programs often need to build a longer piece of text out of smaller pieces.

Joining text sticks pieces together into one. Once you have a piece of text, you can also ask how long it is.

  • Join smaller pieces of text into one message.
  • Measure how many characters a piece of text contains.
  • Works naturally with ASK and SHOW to build messages for the person using your program.
Joining text is like taping strips of paper together to make one longer sentence.
Try it: If a city name is stored in a variable called city, write the JOIN expression that would produce "Welcome to " followed by the city name and a period.

Join pieces of text, then measure the result

JOIN combines the greeting, the name, and the punctuation into one piece of text. LENGTH OF counts its characters.

Pseudocode
CREATE firstName AS "Ava"
CREATE greeting AS JOIN "Hello, " AND firstName AND "!"

SHOW greeting
SHOW LENGTH OF greeting

The same idea in Python

Python joins text with +, and len() measures how many characters a string contains.

Python
firstName = "Ava"
greeting = "Hello, " + firstName + "!"

print(greeting)
print(len(greeting))

The same idea in JavaScript

A template literal is another way to join text with a variable, and .length reports the character count.

JavaScript
const firstName = "Ava";
const greeting = `Hello, ${firstName}!`;

console.log(greeting);
console.log(greeting.length);

The same idea in C#

C# joins text with +, and .Length reports the character count.

C#
string firstName = "Ava";
string greeting = "Hello, " + firstName + "!";

Console.WriteLine(greeting);
Console.WriteLine(greeting.Length);

The same idea in Java

Java joins text with +, and .length() reports the character count.

Java
String firstName = "Ava";
String greeting = "Hello, " + firstName + "!";

System.out.println(greeting);
System.out.println(greeting.length());

The same idea in C++

C++ joins std::string values with +, and .length() reports the character count.

C++
std::string firstName = "Ava";
std::string greeting = "Hello, " + firstName + "!";

std::cout << greeting << '\n';
std::cout << greeting.length() << '\n';
Lesson 10 of 13 · Concept
← Previous Lesson: ListsNext Lesson: Errors →

Learn to Write Code

Learn the idea first, write it in pseudocode, then see how real programming languages express the same logic.

Learn

CurriculumPseudocode StandardLanguagesReal Code

Elsewhere

Code TalkAbout BrianSpread the WordCoders Rock — PracticecodeBetter on YouTubeSupporting files on GitHubAdvertising & Promotions
© 2026 Brian Kittrell, an exteran studios site. Educational content and examples are provided for learning purposes.