String Manipulation
String Concentation definition
String Concatenation Example:
- In Python this is done using a +.
- In the example below we are requesting the
user input their date of birth.
- First they input their date, then month, then year.
- We are storing each of these as strings
Splitting Strings at specific characters -
- Most often, when people enter their date of birth, they enter it by separating the different parts with a forward slash (/).
- In the example below, we are requesting the user enter their date of birth, separating each part with a /.
- We are then splitting this string up at each point where the user enters a /, and in this case storing each new string in a new variable:
Splitting At Specific Characters when you don’t know how many variables you need:
Splitting At Every Character: