Question 1 of 10
The function substring(s, start, end) returns the characters of s from index start through index end inclusive. Indexing starts at 1. What is substring("COMPUTER", 1, 4)?
- A. COMP
- B. COM
- C. OMPU
- D. C
The function substring(s, start, end) returns the characters of s from index start through index end inclusive. Indexing starts at 1. What is substring("COMPUTER", 1, 4)?
What is the value of "AP" + "CSP"?
Using inclusive 1-based substring(s, start, end), what does the segment display?
word ← "ORANGE"
DISPLAY (substring(word, 2, 4))
substring is inclusive on both ends with index 1 at the first character. Which call returns "CAT" from animal ← "CATALOG"?
Trace the segment. substring is inclusive and 1-based.
a ← "SUN"
b ← "FLOWER"
c ← a + substring(b, 1, 4)
DISPLAY (c)
substring(s, start, end) returns the characters from index start through index end, inclusive, with the first character at index 1. For s ← "BANANA", substring(s, 4, 6) equals which string?
| Index | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Char | B | A | N | A | N | A |
What does "hi" + "" + "there" evaluate to?
A student wants the last three characters of code ← "XY9B12" using inclusive substring. Which call is correct?
substring(s, start, end) returns the characters from index start through index end, inclusive, with the first character at index 1. What is displayed?
p ← "blue"
q ← "berry"
DISPLAY (substring(p, 1, 3) + q)
Using inclusive 1-based substring, substring("EXAM", 2, 2) equals: