Strings Flashcards

1
Q

define a string

A

a sequence of 0 or more characters

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

how to find out length of string

A

int = .length();

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

how can we extract individual characters from a string

A

char = .charAt(Location);

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

how do we know the location

A

n-1 as it starts at 0

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

can we use ==, !== to compare strings

A

no

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

what are used to compare strings

A

boolean = .equals(“What we want to find”);

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

if we want to ignore case when comparing what can be used after the stringname.

A

equalsIgnoreCase(“xyz”);

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

can we change individual characters in a string

A

NO

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

what is used to replace all characters in a string

A

just retype variable and newest line will b executed

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