String Methods

String Methods

12th Grade - University

9 Qs

quiz-placeholder

Similar activities

Pop Quiz- Abstraction, Algorithm

Pop Quiz- Abstraction, Algorithm

University

14 Qs

Kontainerisasi dan DevOps

Kontainerisasi dan DevOps

University

10 Qs

Storytelling

Storytelling

University

10 Qs

ICT Computer Basics pt1

ICT Computer Basics pt1

10th - 12th Grade

12 Qs

CHAPTER 1: COMPUTER SECURITY REVIEW

CHAPTER 1: COMPUTER SECURITY REVIEW

University

10 Qs

ระบบทางเทคโนโลยี ม.4

ระบบทางเทคโนโลยี ม.4

10th Grade - University

10 Qs

Basic on Operating System

Basic on Operating System

University

10 Qs

AIJ (Memahami Fairewall)

AIJ (Memahami Fairewall)

University

10 Qs

String Methods

String Methods

Assessment

Quiz

Computers

12th Grade - University

Practice Problem

Medium

Created by

Adam Masters

Used 25+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Returns the character found at a specified position in a string. Positions start at 0 and continue to the number of characters in the string minus 1. For example, the letter ‘h’ is at position 5.

String x = "Joseph";System.out.println(x.charAt(2));
String x = "Joe"; System.out.println(x.equals("Joe"));
String x = "Joseph"; System.out.println(x.substring(2));
String x = "Joseph"; System.out.println(x.substring(2,5));

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Returns a true or false value dependent on whether two strings are equal in value (if they match). Use the [equalsIgnoreCase()] method if the caps sensitivity of the value being matched is not important.

String x = "Joseph";System.out.println(x.charAt(2));
String x = "Joe"; System.out.println(x.equals("Joe"));
String x = "Joseph"; System.out.println(x.substring(2));
String x = "Joseph"; System.out.println(x.substring(2,5));

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Returns a substring (a section of a string) starting at a specified position. Like other methods, the positions start at 0 and continue to the number of characters in the string minus 1.

String x = "Joseph";System.out.println(x.charAt(2));
String x = "Joe"; System.out.println(x.equals("Joe"));
String x = "Joseph"; System.out.println(x.substring(2));
String x = "Joseph"; System.out.println(x.substring(2,5));

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Returns a substring (a section of string) between a start position and end position. The positions start at 0 and continue to the number of characters in the string minus 1.

String x = "Joseph";System.out.println(x.charAt(2));
String x = "Joe"; System.out.println(x.equals("Joe"));
String x = "Joseph"; System.out.println(x.substring(2));
String x = "Joseph"; System.out.println(x.substring(2,5));

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Finds a specified character or characters in a string and replaces it with a specified character or characters.

String x = "joseph"; System.out.println(x.replace("j", "J"));
String x = "Joseph"; System.out.println(x.endsWith("h"));
String x = "joseph"; System.out.println(x.toUpperCase());
String x = " joseph "; System.out.println(x.trim());

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Returns a true or false value dependent on whether the string ends/starts with a specified character or characters.

String x = "joseph"; System.out.println(x.replace("j", "J"));
String x = "Joseph"; System.out.println(x.endsWith("h"));
String x = "joseph"; System.out.println(x.toUpperCase());
String x = " joseph "; System.out.println(x.trim());

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Turns all characters in a string to either UPPER-CASE or lower-case. This can be useful when matching strings given from a user.

String x = "joseph"; System.out.println(x.replace("j", "J"));
String x = "Joseph"; System.out.println(x.endsWith("h"));
String x = "joseph"; System.out.println(x.toUpperCase());
String x = " joseph "; System.out.println(x.trim());

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?