Search Header Logo

(2.7) String Methods

Authored by Robotics IsFun

Computers

12th Grade

Used 2+ times

(2.7) String Methods
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Media Image

String str = "Hello World";

int len = str.length();

System.out.prinlnt(len);

What is the output?

Answer explanation

the length() method returns the number of characters in a String

2.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Media Image

String str = "CompSci Rocks";

int len = str.length();

System.out.prinlnt(len);

What is the output?

Answer explanation

the length() method returns the number of characters in a String

3.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Media Image

String str = "Hello World";

String part = str.substring(0, 1);

System.out.println(part);

What is the output?

Answer explanation

Media Image

the substring() method returns specific section of a String

4.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Media Image

String str = "CompSci Rocks";

String part = str.substring(0, 1);

System.out.println(part);

What is the output?

Answer explanation

Media Image

the substring() method returns specific section of a String

5.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Media Image

String str = "Hello World";

String part = str.substring(3, 4);

System.out.println(part);

What is the output?

Answer explanation

Media Image

the substring() method returns specific section of a String

6.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Media Image

String str = "CompSci Rocks";

String part = str.substring(3, 4);

System.out.println(part);

What is the output?

Answer explanation

Media Image

the substring() method returns specific section of a String

7.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Media Image

String str = "Hello World";

String part = str.substring(2, 7);

System.out.println(part);

What is the output?

Answer explanation

Media Image

the substring() method returns specific section of a String

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?