🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #671

Re: Stringtokenizer

#671
From: Kevin Dean [TeamB]
Date: Tue, 01 Feb 2005 22:09
24 lines
1789 bytes
Matt wrote:

> 
> I'm attempting to break-up a sting with a pipe(|) as the
> Stringtokenizer delimiter. When I have 2 pipes together (||) it skips
> over the pipes instead of seeing them as empty sections. Is there a
> way that I can get Java to see the pipes individually as empty
> sections? Thank you very much.

StringTokenizer is a legacy class; the documentation recommends that
you use the String.split() method instead:

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#split(java
.lang.String)

The example presented there looks like the method will do what you want.

-- 
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/

Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <xn0dxzr53b2wek003-kdean@www.teamb.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <41fffc53$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,42719a13be6c5a03
X-Google-Attributes: gidf74b3,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Kevin Dean [TeamB]" <NkOdSePaAnM@datadevelopment.com>
Subject: Re: Stringtokenizer
Newsgroups: borland.public.jbuilder.java.language
References:  <41fffc53$1@newsgroups.borland.com>
Organization: Dolphin Data Development Ltd.
User-Agent: XanaNews/1.17.1.2
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr
 p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
Message-ID: <xn0dxzr53b2wek003-kdean@www.teamb.com>
X-Ref: newsgroups.borland.com ~XNS:00000042
NNTP-Posting-Host: 24.57.153.235
Date: 1 Feb 2005 14:09:14 -0800
X-Trace: newsgroups.borland.com 1107295754 24.57.153.235 (1 Feb 2005 14:09:14 -0800)
Lines: 24
X-Authenticated-User: kdean
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed-east.nntpserver.com!nntpserver.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail