String Methods Flashcards

1
Q

Returns the character of a string based on the specified index.

A

charAt

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

Compares a string with another string.

A

compareTo

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

Returns a new string concatenated with the value of the parameter

A

concat

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

Returns true if this string and the specified string are equal.

A

equals

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

Returns true if this string and the specified string are equal, considering the uppercase and lowercase versions of a letter to be the same.

A

equalIgnoreCase

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

Returns the index of the first occurrence of the specified within this string.

A

indexOf

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

Returns the index of the last occurrence of the specified within this string.

A

lastIndexOf

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

Returns the length of the string in int type.

A

length

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

Returns a new string having the same characters as this string, but with any uppercase letters converted to lowercase.

A

toLowerCase

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

Returns a new string having the same characters as this string, but with any lowercase letters converted to uppercase.

A

toUpperCase

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

Returns a new string having the same characters as this string, but with each occurrence of specified old_char replaced by new_char.

A

replace

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

Returns a new string having the same characters as the substring begins at specified start index through the end of the string.

A

substring(start_index)

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

Returns anew string having the same characters as the substring that begins at specified index start through to but not including the character at index end.

A

substring(start, end)

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

Returns a new string having the same characters as this string, but with leading and trailing whitespace removed.

A

trim

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