I'm looking for terminator characters in Strings using indexOf.
// character codes to look for
int[] defseps = new int[] {10, 13, 34, 36, 38, 39,41, 44, 59, 63, 93, 125};
int t = 999999999; // big number, We want first terminator
int tempt = 0;
// loop through possible terminators
for (int x = 0; x < 12; x++) {
tempt=str.indexOf(defseps[x]); // Get index of terminator
if (defsepactivated[x] && tempt!=-1) { // If active terminator found
System.out.println("defsep used=" + defseps[x]);
if (tempt < t) t = tempt; // Use this terminator if before previous found
}
}
This code finds terminators like & (38) and ] (93) but not double quote (34).
For example if str is : =THINGTHUNG";copyright © it finds the semi colon and & but not the double quote.
Much appreciate why that would be the case before I try other codings.