dcsimg
StringTokenizer class
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, March 26, 2003 02:47 PM

Hi,

I am using the StringTokenizer to read data fields from a pipe ("|") delimited file. I am unable to read null value fields.

For example, if my input file is as follows:

XYZ|ABC||TTT|333

I am unable to read the 3rd value (the value after ABC). How can I read that value? I am using the StringTokenizer class as follow:

StringTokenizer t = new StringTokenizer(s, "|");

How do I modify this declaration so that I can read the null values mentioned above?

Thanks for your help.

Re: StringTokenizer class

Posted By:   Rob_Eamon  
Posted On:   Wednesday, March 26, 2003 07:34 PM

This is known issue with the StringTokenizer class in which null/empty tokens are not returned. A replacement class can be found at http://ostermiller.org/utils/StringTokenizer.html
About | Sitemap | Contact