String Methods

Quiz
•
Computers
•
9th - 12th Grade
•
Hard
David Hedin-Abreu
Used 462+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Choose the line that assigns "love" to str2.
str2 = str.substring(2,6);
str2 = str.substring(2,5);
str2 = str.substring(2);
str2 = str.substring(4);
2.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Choose the line that assigns "boba." to str2.
str2 = str.substring(7);
str2 = str.substring(7,11);
str2 = str.substring(8,12);
str2 = str.substring(8);
3.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Choose the line that assigns "I" to str2.
str2 = str.substring(0,1);
str2 = str.substring(1,2);
str2 = str.substring(0);
str2 = str.substring(1);
4.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
What is the output from running this code block?
equals method
== operator
(Nothing)
equals method
== operator
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
What is the result of running this code block?
"." is printed.
An exception is thrown.
"America." is printed.
"a" is printed.
6.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
What is the result of running this code block?
"." is printed.
An exception is thrown.
"America." is printed.
"a" is printed.
7.
MULTIPLE SELECT QUESTION
3 mins • 1 pt
What method-call below could be used to determine whether str contains the String "States"? Choose all that apply.
str.contains("States")
str.indexOf("States")
str.equals("States")
str.compareTo("States")
Create a free account and access millions of resources
Similar Resources on Wayground
11 questions
Введение в программирование

Quiz
•
9th Grade
8 questions
Procedures Code Tracing

Quiz
•
9th Grade
6 questions
Topic 4.3 Video 1

Quiz
•
11th Grade
14 questions
AP CSA Review

Quiz
•
11th Grade
10 questions
(Do Now) Excel Functions Quiz

Quiz
•
12th Grade
15 questions
Programming terminology

Quiz
•
9th Grade
15 questions
AQA Computer Science GCSE - 3.1 Fundamentals of algorithms

Quiz
•
10th - 12th Grade
7 questions
Examen de Taller de Programación Concurrente -semana 7

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade