String Manipulation (OCR GCSE Computer Science): Flashcards
📚Flashcards
Practise the cards
13 cards from this deck
ShowHide
Practise the cards
13 cards from this deck
What is string manipulation?
What is string manipulation?
Modifying, analysing & working with text data (strings)
What a string is
What a string is
A sequence of characters
What does len() function do?
What does len() function do?
Calculates number of characters in a string
No. of characters in 'Hello, World!'
No. of characters in 'Hello, World!'
13 characters
What does upper() method do?
What does upper() method do?
Converts all letters in string to uppercase
What does lower() method do?
What does lower() method do?
Converts all letters in string to lowercase
String slicing purpose
String slicing purpose
Extracting a smaller part (substring) from a string
What text[0:5] extracts
What text[0:5] extracts
Characters from index 0 up to (not including) index 5
What is string concatenation?
What is string concatenation?
Joining two or more strings together
Operator for string concatenation
Operator for string concatenation
- operator
What does replace() function do?
What does replace() function do?
Replaces specific parts of string with new text
What does 'in' keyword do in strings?
What does 'in' keyword do in strings?
Checks if substring exists within a string
Practical use: length check
Practical use: length check
Ensure inputs meet length requirements (e.g., 8 char password)
