Search Header Logo

String Methods Quiz

Authored by Sáng Nguyễn

Computers

12th Grade

String Methods Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the method charAt(index) return?

A new string created from UTF-16 code units

The index of the first occurrence of a value

The character at the specified index

The Unicode of the character

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is returned by charCodeAt(index) if the index is out of bounds?

An empty string

The length of the string

The character at the last index

NaN

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does String.fromCharCode(...) do?

Replaces a substring in a string

Finds the last occurrence of a value

Converts a string to lowercase

Returns a string from UTF-16 code units

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the indexOf(searchValue[, fromIndex]) method return if the value is not found?

0

-1

null

undefined

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the replace(searchValue, newValue) method?

To convert a string to uppercase

To split a string into an array

To replace matches of a pattern with a new value

To find the index of a character

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the split(separator[, limit]) method return?

A new string

An array of substrings

The length of the string

The first character of the string

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the substring(indexStart[, indexEnd]) method do?

Returns a new substring from the specified start index

Replaces a substring in the string

Converts the string to lowercase

Finds the last index of a character

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?