Okay, now that you’ve explained your problem and where it is you’re stuck, I am much more able to help you.
What you’re trying to do is compare a char
to an array
. You can’t do. You need to loop over the array for each character, as such:
char[] splitNumber = encryptedNumber.toCharArray();
for (int i=0; i < encryptedNumber.length(); i++) {
char c = encryptedNumber.charAt(i);
for (int j=0; j < conversionTable.length; j++) {
if (c == conversionTable[j][0].charAt(0)) {
// do whatever you want here
}
}
}
The inner loop will iterate over the rows of the array and for each row j, will retrieve the value in its’ first column (at index 0).
2
solved Programmr “replacing and converting Strings” Java [closed]