I am trying to find a character array inside of a character array so that in the array, A would be followed by B. For some reason, I do not get an error but I also cannot get it to do the work I want when I have an array with the combination. I was just wondering if someone could explain what I am doing wrong and point me in the right direction.
char[] Array = new char[] {'A','B','C','D'....};
char A = 'A';
char B = 'B';
....
for (int i = 0 ; i < Array.length; i ++) {
if (Array[i] == A && Array[i++] == B) {
//Work Here
}
}