Professional Documents
Culture Documents
Sapt 5 String Processing Quizz Sect 3 L3
Sapt 5 String Processing Quizz Sect 3 L3
Section 1
Correct
Correct
3. Identify the method, of those listed below, that is not available to both StringBuilders and Strings?
length()
delete(int start, int end) (*)
charAt(int index)
indexOf(String str)
Correct
True (*)
False
Correct
Correct
6. In a regular expression, {x} and {x,} represent the same thing, that the preceding character may
occur x or more times to create a match.
True or false?
True
False (*)
Correct
7. Your teacher asks you to write a segment of code that returns true if String str contains zero or one
character(s) and false otherwise. Which of the following code segments completes this task?
Correct
9. Which of the following correctly initializes a Matcher m for Pattern p and String str?
Correct
10One benefit to using groups with regular expressions is that you can segment a matching string and
. recall the segments (or groups) later in your program.
True or false?
True (*)
False
Correct
Page 1 of 1