I can never get this to loop all the way through the string. I can't use >= or == in this loop it stops it from working :( help
int s = 0;
String twocharacters = "";
for (int i = 0; i < value.length(); i++){
char c = value.charAt(i);
char w = value.charAt(i + 1);
if (c == '/' && w == '*' && s == 0){
s = 1;
}
else if (c == '*' && w == '/' && s == 1){
s = 0;
}
else if (s == 0 && c != ' ' && c != '*' && c != '/'){
twocharacters += c;
System.out.println(twocharacters);
}
}
charAt(i + 1).char w = value.charAt(i + 1)will lead to an exception wheni == value.length() - 1