ProgrammingTopic Summary

Knowledge Organiser: String Handling

Part of String Handling · GCSE GCSE Computer Science revision

This topic summary covers Knowledge Organiser: String Handling within String Handling for GCSE Computer Science. Revise String Handling in Programming for GCSE Computer Science with 15 exam-style questions and 8 flashcards. This topic appears less often, but it can still be a useful differentiator on mixed-topic papers. It is section 7 of 7 in this topic. Use this topic summary to connect the idea to the wider topic before moving on to questions and flashcards.

Topic position

Section 7 of 7

Practice

15 questions

Recall

8 flashcards

Knowledge Organiser: String Handling

Key Terms
  • String: A sequence of characters stored as text
  • Concatenation: Joining two strings together using + (e.g. "Hello" + " " + "World")
  • Substring: Extracting part of a string using string.substring(start, length)
  • Length: The number of characters in a string, accessed with string.length
  • ASC: Converts a character to its ASCII code number (e.g. ASC("A") = 65)
  • CHR: Converts an ASCII code number to a character (e.g. CHR(65) = "A")
Must-Know Facts
  • Strings are 0-indexed: the first character is at position 0
  • substring(start, length) takes a starting position and a number of characters, NOT an end position
  • String operations return a new string — the original is not changed
  • .upper and .lower convert case for comparison purposes
  • ASC("A") = 65, ASC("a") = 97 — upper and lower case have different codes
Key Concepts
  • Get length: "Hello".length returns 5
  • Extract chars: "Hello".substring(0, 2) returns "He"
  • Convert case: "Hello".upper returns "HELLO"
  • Join strings: "First" + " " + "Last" returns "First Last"
  • ASCII: ASC("A") = 65; CHR(65) = "A"
Common Mistakes
  • Using 1-based indexing instead of 0-based: Strings are 0-indexed in most pseudocode — the first character is at position 0, not 1
  • Confusing substring's second argument: substring(start, length) takes a LENGTH (number of characters), not an end position — substring(2, 3) gets 3 characters from position 2
  • Forgetting case when comparing strings: "Hello" does not equal "hello" — use .upper or .lower to standardise case before comparison
  • Confusing ASC and CHR: ASC converts a character TO its ASCII number; CHR converts an ASCII number TO a character — they work in opposite directions
  • Trying to add a number directly to a string: Concatenation joins strings — a number must be converted to a string first before joining with +

Revise this topic interactively on PrepWise — self-test mode, tap-to-reveal definitions, and Common Mistakes from examiners.

Try the interactive Knowledge Organiser — free →

Keep building this topic

Read this section alongside the surrounding pages in String Handling. That gives you the full topic sequence instead of a single isolated revision point.

Practice Questions for String Handling

The string variable word = "Hello". What does word.length return?

  • A. 4
  • B. 5
  • C. 6
  • D. 0
1 markfoundation

Explain the purpose of the ASC() and CHR() functions in OCR pseudocode. Give one reason a programmer might need to convert between characters and their ASCII codes.

3 marksstandard

Quick Recall Flashcards

How do you join strings?
Concatenation: string1 + string2
What does CHR(66) return?
"B"

15 questions on String Handling — practise free

Instant marking, adaptive difficulty, and 8 spaced repetition flashcards. Free until your GCSEs.

Try PrepWise Free