Strings are used to store textual data. We use them when we want to store information that most of us think of as characters or or letters (like words and sentences).
How Do We Use Strings?
You can concatenate (combine) strings by using the addition (+) operation. Concatenating works for both strings and variables that are assigned to strings.
Reminder: don’t forget to add spaces when you combine strings!
Converting Data Types
- You can convert ints into strings, but you can only convert ints to strings if they have numeric values.
- Converting a word into an int won’t work, as shown below:
This makes sense since you can treat numbers as a string of characters, but you can’t express a word in numbers