Strings - 3.4
Lesson on Strings from Collegeboard
Strings
What is a string?
- A string is a collection of charecters. What is a charector as charector can be anything from numbers, letters, spaces, special symbols, etc.
- Certain procedures may be used with strings and they vary from progaramming language to language Python examples
- len() to find the length of a string
- lower() to converte to lowercase
- etc. Psuedocode examples
- len() returns the lengh of a string
- concat() returns a string made up of the concatenated strings ex. concat("string1", "string2") would return string1string2
- substring() returns the charectors from the string beginning at the at the first position to the last so an example of this would be substring("abcdefghijk", 2, 5) would print bcde (puesdocode starts at 1)
- Note: selections are conditional statements in collegeboard
String Concatenation
What is string concatenation?
- String concatenation is combining 2 or more strings to make a new strings in order to create a new string
- concat() in pusedocode and varys from language to language can be used to combine to strings such as concat("cookie","monster") returns cookiemonster