• Post Reply Bookmark Topic Watch Topic
  • New Topic

delimiters in StringTokenizer  RSS feed

 
AJ sisodia
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could u explain delimiters in simple Language.
 
Hilton Meyer
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!