I am trying to check whether the position in the array where the two strings are different. For example if I have the String apple and the string appendix then the two string are different at the position where i = 3.
How can I check that with Java?
Code
//The first string is s.
char[] cArray = s.toCharArray();
// The seond string is root.edge.
char[] rootEdgeCharacter = root.edge.toCharArray();
for(int i=0; i<cArray.length; i++ ){
for(int j=0; j<rootEdgeCharacter.length; j++){
if(cArray[i]== rootEdgeCharacter[j]){
System.out.println("The String are different where i =" + i);
}
}
}