String Processing Flashcards

1
Q

Returns the starting position of a substring within a string, or -1 if not found. Has overloaded version that can specify starting index.

A

int indexOf(substring)

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

Starting from offset, check if the string has a prefixString

A

boolean startsWith(String prefixString, int offset)

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

Starting from 0, checks if the string has prefixString.

A

boolean startsWith(String prefixString)

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

Check if the string has a suffixString.

A

boolean endsWith(String suffixString)

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

Starting from start in this String object, check if the region of text given by matchingStr matches. In matchStr, check for matchLen characters starting from matchStartOffset. Has an additional first paramater that causes it to ignore case.

A

boolean regionMatches(boolean ignoreCase, int start, String matchingString, int matchStartOffset, int matchLen)

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

Converts primitive values to strings.

A

valueOf(primitive)

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

Returns an array of substrings of a string split by a delimiter.

A

String[] split(String delimiter)

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