String Flashcards

1
Q
String to char array
char at specific location ??
index of specific char ??
last occurrence of specific char ??
if char is a digit ?
A
toCharArray()
charAt(index)
indexOf(char c)
lastIndexOf(char ch)
Character.isDigit(char ch)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Ascii number starting from ‘A’ - ‘Z’

Ascii number starting for ‘a’ - ‘z’

A

65-90

97-122

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

Character addition
char methods to check if char is numeric ?
method to get numeric value of a char

A

will give ascii number addition of chars.
- Character.isDigit(c)
- c - ‘0’ -> gives int
Character.getNumericValue(c)

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

Comparator

A

compare(a,b)
if a > b return positive integer
A < b , negative integer
A== b , 0

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

Adding element to specified location or first, last

A

LinkedList

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

String contains digit

A

s.matches(.\d+.”)

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