Hello guys here is my code
for (int i = 0; i <= alignedSeqA.length(); i++) {
if(alignedSeqA.charAt(i)==alignedSeqB.charAt(i)) {
alignedSeqPenalty +="0";
}
else if(alignedSeqA.charAt(i)=='-'){
alignedSeqPenalty +="2";
}else if(alignedSeqB.charAt(i)=='-'){
alignedSeqPenalty +="2";
}else if(alignedSeqA.charAt(i)!=alignedSeqB.charAt(i)){
alignedSeqPenalty +="1";
}
}
and here is my error
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 10
at java.lang.String.charAt(Unknown Source)
at New.main(New.java:124)
when i changed my alignedSeqA.length() with an integer (like 7) it works just fine
i.e. --> output when i change it to 7 20100201
what am i doing wrong?
Thank you