Computer Science · B2.1 Programming Fundamentals

B2.1.2 — Substrings: Extracting and Manipulating Text

Preview

IB DP Computer Science — B2 Programming — Programming fundamentals | SL | B2.1.2

📋 What You Will Learn

  • Describe a string as an indexed sequence of characters (zero-based)
  • Extract substrings with Java substring(start, end) and Python slicing s[start:end]
  • Locate text with indexOf / find and combine it with extraction
  • Manipulate strings: alter (case, rebuild), concatenate (+) and replace
  • Construct and trace string-processing loops character by character

✂️ Why This Matters A string is a strip of lettered tiles glued in order, each with a position number starting at 0. Extracting a substring is cutting a run of tiles out as a copy — the original strip is never changed. Every email parser, search box and data-cleaning script is built from exactly these cuts.

Strings Are Indexed Sequences

📖 Definition —

Continue reading the full note