What portion of a text refers to a contiguous sequence within a larger text?

Prepare for the IGCSE Algorithms and Pseudocode Exam. Study with comprehensive questions covering key algorithms and pseudocode techniques. Access hints and explanations to gear up for your exam success!

Multiple Choice

What portion of a text refers to a contiguous sequence within a larger text?

Explanation:
A substring refers to a contiguous piece of a string. It’s any sequence of characters that appear in order with no gaps inside a larger text, defined by a starting position and a length (or an end position). For example, from "abcdef", the substring starting at the second character with length three is "bcd". This is exactly a portion that sits contiguously inside the whole text. Length, by contrast, tells you how many characters are in the entire string rather than which part you’re looking at. Lower relates to changing case, not selecting a segment. Arithmetic operators are symbols used for math, not for picking parts of text. So the term that best captures a contiguous portion of a bigger text is substring.

A substring refers to a contiguous piece of a string. It’s any sequence of characters that appear in order with no gaps inside a larger text, defined by a starting position and a length (or an end position). For example, from "abcdef", the substring starting at the second character with length three is "bcd". This is exactly a portion that sits contiguously inside the whole text.

Length, by contrast, tells you how many characters are in the entire string rather than which part you’re looking at. Lower relates to changing case, not selecting a segment. Arithmetic operators are symbols used for math, not for picking parts of text. So the term that best captures a contiguous portion of a bigger text is substring.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy