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)
2
Q
Ascii number starting from ‘A’ - ‘Z’
Ascii number starting for ‘a’ - ‘z’
A
65-90
97-122
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)
4
Q
Comparator
A
compare(a,b)
if a > b return positive integer
A < b , negative integer
A== b , 0
5
Q
Adding element to specified location or first, last
A
LinkedList
6
Q
String contains digit
A
s.matches(.\d+.”)