methods Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

.equals()

A

Checks if the values of two objects are equivalent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

.compareTo()

A

Compares two Strings alphabetically, returns 0 if Strings are identical, negative if left value comes first, positive if right value comes first.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

.toUppercase()

A

Returns all the characters in a string capitalized.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

.toLowercase()

A

Returns all the characters in a string as lowercase letters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

.length()

A

Returns the number of characters a string contains.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

.substring(x)

A

Returns a substring of the String that begins at index “x” and goes to the end.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

substring(x, y)

A

Returns a substring of the String that begins at index “x” and goes to index “y.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

.indexOf(String x)

A

Returns the index location that the substring “x” first appears in a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly