Strings Flashcards
1
Q
define a string
A
a sequence of 0 or more characters
2
Q
how to find out length of string
A
int = .length();
3
Q
how can we extract individual characters from a string
A
char = .charAt(Location);
4
Q
how do we know the location
A
n-1 as it starts at 0
5
Q
can we use ==, !== to compare strings
A
no
6
Q
what are used to compare strings
A
boolean = .equals(“What we want to find”);
7
Q
if we want to ignore case when comparing what can be used after the stringname.
A
equalsIgnoreCase(“xyz”);
8
Q
can we change individual characters in a string
A
NO
9
Q
what is used to replace all characters in a string
A
just retype variable and newest line will b executed