What is a String? String: A sequence of characters, usually used to express words or sentences.
Everything inside the quotes is in the string.
The quotes are not part of the string!!!
All characters in the string are included, including the space character!!!
Commands in strings
How to check the length of the string? len() command.
How to check how many times the word or text appears in a string? string.count(“...”) command.
Each character in the string is numbered from 0 to the end of the string.
A specific value in a string can be accessed by using [ ].
Remember! You can access the character in the opposite way:
A substring can be cut from the original string by using colons inside [::], which allows start, end and jump (if necessary).
Remember: The last character will not be included in the cut!
How to check if the substring is in the string? in command.
How to check where the substring is located? string.find("...") command.
How to replace part of the string with a substring that the user specifies? string.replace("xxxx","yyyy") command.
How to make the letters upper/lower case? string.upper() ||| string.lower() command.
How to check if the string starts/ends with a substring that the user sets? string.startswith("...") ||| string.endswith("...") command.
How to check if the string contains only numbers? string.isdigit() command.
How to check if the string contains only letters? string.isalpha() command.
How to loop through a string?
This part requires knowing lists:
How to turn a list into text? "...".join(lst) command.
How to turn text into a list? string.spilt("...") command.
How to turn text into a list, so that each letter is a member? list(string) command.