Which term describes extracting a portion of text by selecting a start and end position?

Study for the IGCSE Algorithms and Pseudocode exam to demonstrate mastery of computing foundations. Enhance learning with quizzes, in-depth explanations, and custom study plans. Begin your journey to success now!

Multiple Choice

Which term describes extracting a portion of text by selecting a start and end position?

Explanation:
The operation is called a substring: it describes taking a contiguous portion of a string by choosing where it starts and where it ends. This produces a new string consisting of the characters in that range. In many languages, the end position is exclusive, so you include characters from the start index up to (but not including) the end index. For example, from "abcdef" with a start of 1 and an end of 4 you’d get "bcd" in the end-exclusive convention. The other terms don’t fit this idea: lower/upper relate to changing letter case, and length is just the total number of characters in the whole string.

The operation is called a substring: it describes taking a contiguous portion of a string by choosing where it starts and where it ends. This produces a new string consisting of the characters in that range. In many languages, the end position is exclusive, so you include characters from the start index up to (but not including) the end index. For example, from "abcdef" with a start of 1 and an end of 4 you’d get "bcd" in the end-exclusive convention. The other terms don’t fit this idea: lower/upper relate to changing letter case, and length is just the total number of characters in the whole string.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy