I have a very long String and I want to read character by character until the end of the String.
In Java, I found two ways to read it:
- Using CharAt.
- Using StringReader.
Can anybody help me:
- Which one is the faster way ?
- How to use StringReader to read character by character until the end
of the String ?
Thanks in advance.
charAt()Reader, so it has the same methods as any otherReader, includingint read()which will return you the Unicode code point for each character, one by one