I am trying to skip values using a for loop. Something like
for(int i = 32; i <= 255 - but skip 128 to 159; i++) {
char ascii = (char) i;
System.out.println(ascii);
}
Any suggestions? Thanks!
Use this at the beginning of your loop:
for(int i = 32; i < 256; i++) {
if(i == 128) i = 160;
//...
}
This is MUCH better than simply continuing. You don't want to iterate over 128 to 159; you'd be wasting time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With