String-handling Operations (AQA GCSE Computer Science): Flashcards
📚Flashcards
Practise the cards
12 cards from this deck
ShowHide
Practise the cards
12 cards from this deck
String concatenation
String concatenation
Joining multiple strings together
Operator for string concatenation
Operator for string concatenation
The + operator
Order in string concatenation
Order in string concatenation
Strings joined in exact order specified
Operator overloading
Operator overloading
- does different things based on data type
- operator with numbers
- operator with numbers
Performs mathematical addition ()
- operator with strings
- operator with strings
Joins strings ("hello"+"world"="helloworld")
Automatic spaces in concatenation
Automatic spaces in concatenation
No, must add spaces manually
Result of "hello"+"world"
Result of "hello"+"world"
"helloworld" (no space)
Adding space in concatenation
Adding space in concatenation
"hello"+" "+"world" = "hello world"
Effect on original strings
Effect on original strings
Creates new string, originals unchanged
Example: user greeting concatenation
Example: user greeting concatenation
"Hello, " + username
Mixing literals and variables
Mixing literals and variables
Yes, can combine both in concatenation
