String
A string is a data type used to represent text.
It is a sequence of characters enclosed in quotation marks.
Why strings are important
Strings are used to:
Display messages
- Store names and text
- Work with user input
- Handle data like emails, passwords, and addresses
Almost every program uses strings.
How strings look
Strings are written inside quotes.
Example:
Both represent text values.
String variable
You can store a string in a variable.
Now the variable name contains text.
String concatenation
You can store a string in a variable.
Now the variable name contains text.
String concatenation
Strings can be combined.
Result → "Hello World"
Example with variable:
String length
Many languages allow you to check how long a string is.
Example:
Result → 5
Strings vs Numbers
Important difference:
Text values behave differently from numbers.
Why learning strings matters
Understanding strings helps you:
- Work with text data
- Display dynamic content
- Process user input
- Build real-world applications
Most software interacts with users through text.
Simple example
Think of a string like a word written on paper. It’s not a number — it’s text made of characters.
Related terms
- What is Data Type?
- What is Variable?
- What is Expression?
Source
Simplified from general programming documentation and Wikipedia.