This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes IS SPACE A VALID DELIMITER? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "IS SPACE A VALID DELIMITER?" Watch "IS SPACE A VALID DELIMITER?" New topic
Author

IS SPACE A VALID DELIMITER?

ZEESHAN AZIZ
Ranch Hand

Joined: Jan 15, 2001
Posts: 162
I WANT TO READ A TEXT FILE, AND INTEND TO USE SPACE AS A DELIMITER. IT IS NOT WORKING OUT, AND COMPILER IS NOT RECOGNISING SPACE AS A DELIMITER.
I WONDERED WHETHER SPACE IS A VALID DELIMITER.
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120

JLS 3.2:
" 1. A translation of Unicode escapes (�3.3) in the raw stream of Unicode characters to the corresponding Unicode character. A Unicode escape of the form \uxxxx, where xxxx is a hexadecimal value, represents the Unicode character whose encoding is xxxx. This translation step allows any program to be expressed using only ASCII characters.
2. A translation of the Unicode stream resulting from step 1 into a stream of input characters and line terminators (�3.4).
3. A translation of the stream of input characters and line terminators resulting from step 2 into a sequence of input elements (�3.5) which, after white space (�3.6) and comments (�3.7) are discarded, comprise the tokens (�3.5) that are the terminal symbols of the syntactic grammar (�2.3).
"
JLS 3.6:
"
White space is defined as the ASCII space, horizontal tab, and form feed characters, as well as line terminators.
"

How are you using them?
Have you tried the StringTokenizer class to get the words?


SCJP2. Please Indent your code using UBB Code
Guoqiao Sun
Ranch Hand

Joined: Jul 18, 2001
Posts: 317
Hi, Zeeshan, the following code might be useful to you:

Hope it helps,

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
try my mock exam¹²³ at my homepage.


Guoqiao Sun<br />SCJP2 SCWCD2<br />Creator of <a href="http://www.jiris.com/" target="_blank" rel="nofollow">www.jiris.com</a>, Java resource, mock exam, forum
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IS SPACE A VALID DELIMITER?
 
Similar Threads
Breaking a string down and tokenizers - help!
Reading String contains space using Scanner (Its too Urgent please!!!!)
Removing Smileys from Chatlog
disecting a string
Converting/reformatting data from text file(with delimiters)