aspose file tools
The moose likes Beginning Java and the fly likes delimiters in StringTokenizer Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "delimiters in StringTokenizer" Watch "delimiters in StringTokenizer" New topic
Author

delimiters in StringTokenizer

AJ sisodia
Greenhorn

Joined: Jan 19, 2005
Posts: 16
could u explain delimiters in simple Language.
Hilton Meyer
Greenhorn

Joined: Nov 13, 2003
Posts: 17
As I can understand the delimiters used by StringTokenizer there is the default delimiters which are whitespace characters(blank,new line or any other separators that are whitespace if you sere to print them on paper) and this is set up with something like:

If you wanted to specify which each separator is you would need to use the constructor where you can specify the delimiters or separators that you can make up:

This part in inverted comma's: " \n%." are your specified delimiters. the first is a space followed by \n which is new line then % and .
These are all your own separators and you can use basically any symbol as a separator or delimiter as long as you specify it when initialising the variable(in this case sentence)
Hope this helps but if you need something's unclear give me a shout because it has helped me a bit better in understanding the StringTokeniser Class.

[ January 25, 2006: Message edited by: Hilton Meyer ]
[ January 25, 2006: Message edited by: Hilton Meyer ]

Keep it Tidy
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14672
    
  11

In simple language, is what separates one thing from another thing.

1,2,3,4,5
Comma is the delimiter of this list of numbers.
With StringTokenizer, you could grab each of those numbers by specifying that their delimiter is a comma.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: delimiters in StringTokenizer
 
Similar Threads
absctract class
CSV Dowlnload and MS Excell 2000
String.split Vs StringTokenizer
Scanner Doubt!
Eclipse Java Editor