1+2+69+4=76; in the first case it was perceiving the 123 and the 45 as matching the regex supplied: 1+2+69+4+123+45=244.
Enter tokens: 0 to finish: Coderanch 1 2 69 is brilliant 4 ldhdl 123.45 0
Enter more tokens: 0 to finish: Coderanch 1 2 69 is brilliant 4 ldhdl 123.45 0
If you don't have some means of stopping the Stream, it may turn into an infinite Stream.
There isn't a lines() method, but it should be easy enough to get lines from tokens() with something like
useDelimiter("\r|\n|\r\n") or useDelimiter(System.lineSeparator())
I see there is a hasNext() method, but the remove
Obviously Iterator#remove() will be called an optional operation. It always struck me as peculiar that you can have interfaces with optional operations, but I suppose that is how you get Lists where you can add elements and Lists where you can't add elements.
operation is not supported by this implementation of Iterator.
Thank you for joining us to discuss this question
Campbell Ritchie wrote:Even confirmed Scannerophobes like Winston thought that should be possible.
I resemble that remark!
Hi all. Long time no Ranchee. Though I'd pop back to find some pearls of wisdom about Java 9, since I've just acquired a new laptop for a steal (150 quid for a 5-year old i5 HP, with 8 gig and and a fingerprint scanner) and want to install it.