A string is just an ordered list of characters, and once you can measure it and pull pieces out of it you can do real work like validating passwords or splitting a name. In this lesson we use the Cambridge pseudocode string functions LENGTH, SUBSTRING, UCASE and LCASE, plus the & operator for joining strings together.
1. Which string function returns the number of characters in a string?
2. What does SUBSTRING("COMPUTER", 4, 3) return?
3. What is the result of the expression "RE" & "VISE"?
4. A password must be at least 8 characters long. Which expression is TRUE when the password is too short?
Practise real exam questions on this
Type your answer, see your mark against the mark scheme in seconds. Free, 5 a day.
Start practising →
Teaching this topic?
Mark your whole class's answers and see who's stuck, for £19 a month.
See the class plan →
Free revision content. Multiple-choice answers are marked instantly. Written answers are marked by AI on /free-mark.