About Question enthuware.ocpjp.v7.2.1625 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
Velocidrak
Posts: 3
Joined: Sun May 19, 2013 5:45 pm
Contact:

About Question enthuware.ocpjp.v7.2.1625 :

Post by Velocidrak »

In the highlighted answer, it mentions this:
Default delimiters i.e. " \t\n\r\f" will be used to tokenize the string. Further, the delimiters themselves will not be returned as tokens. Thus, it will return the following tokens: tokens, with, tabs, and, new, lines. Had it been: StringTokenizer st = new StringTokenizer(str, " \t\n\r\f", true), it would have returned 14 tokens: tokens, (tab character), with, (space character) , tabs, (space character), and, (space character), (space character), (CR character), (Line Feed character), new, (space character), lines. (Note: comma and the leading space in the above list of tokens are not part of the tokens but are there just to present the output here.)
When I tested this particular scenario(that it shows above), it returned 13 instead of 14. I believe this may be because in the tokens that are mentioned above, it shows that there are two spaces after "and" when there appears to be only one space after the "and" in the actual code.

I could be wrong though, just want to make sure that I'm not testing or understanding something incorrectly.

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1625 :

Post by admin »

You are right. It should be 13 and not 14. This has now been fixed.
thank you for your feedback!
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests