Strings, procedures and functions
Watch the whole lecture free
Make a free account to watch every lecture to the end: 9 practice questions, 2 real past-paper questions with the answers explained, the mistakes that lose marks, the full-marks tip, a one-card summary and a quick quiz.
That was the teaching part. The rest of this lecture is free with an account: 9 practice questions, 2 real past-paper questions with the answers explained, the mistakes that lose marks, the full-marks tip, a one-card summary and a quick quiz.
No password needed now: we email you a link to set one. Already have an account? Sign in, then come back to this page.
The teaching part (1 min) is free to watch. A free account opens the whole lecture: 9 practice questions, 2 real past-paper questions with the answers explained, the mistakes that lose marks, the full-marks tip, a one-card summary and a quick quiz.
What this lecture covers
- Cutting words, building blocks
- Positions in a string
- String routines
Read the transcript of the teaching part
Last time
Before we start: last time, in Databases and SQL, you learned these points. Here they are again on one card. Keep them in mind, because today builds on them.
Cutting words, building blocks
Programs handle text all day: usernames, messages, passwords. Library routines cut words, measure them and change their case. And once a task works, we wrap it in a named block that we can use again and again. Those blocks are procedures and functions.
Positions in a string
In Cambridge pseudocode, the first character of a string is at position one. Here is the word Computer. C is position one, o is two, and so on, up to r at position eight. So its length is eight.
String routines
LENGTH gives the number of characters in a string. UCASE changes every letter to upper case, and LCASE to lower case. SUBSTRING takes part of a string: the start position, and how many characters. The ampersand joins two strings together. This is called concatenation.
Chapter 8.1: Strings and subroutines
- Strings, procedures and functions 6 min
Also for IGCSE Computer Science 0478
Which topics come up most in IGCSE Computer Science 0478 past papers, counted from every paper since 2004: Paper 1 topic frequency, Paper 2 topic frequency.