Well, you give very little context about your intentions.
If it is safe to assume that currentCharIndex is within the correct bounds, you might get rid of the assignment outside of the loop by using do { } while.
Or, you get rid of the imperative style by using Streams (you get an IntStream from a String using the chars() method in Java 8).
Well, you give very little context about your intentions.
If it is safe to assume that currentCharIndex is within the correct bounds, you might get rid of the assignment outside of the loop by using do { } while.
Or, you get rid of the imperative style by using Streams (you get an IntStream from a String using the chars() method in Java 8).
Interesting. I'm actually creating a tokenizer for a programming language we came up as part of our course curriculum.