🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #642

Re: StringReplace function

#642
From: John McGrath TeamB
Date: Mon, 24 Mar 2003 06:34
21 lines
1590 bytes
On Mon, 24 Mar 2003 14:02:24 +0800, RaynorPao wrote:

> Is there an API like "StringReplace" in Java?

See the replaceAll() and replaceFirst() methods in the String class.  
These work with regular expressions, so they are quite a bit more 
powerful than the method you describe.

However, these methods were introduced in Java 1.4.  Previous Java 
versions (and 1.4 as well) have a replace() method that will replace 
each occurrence of one character with another, but that does not seem 
to be what you need.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.18e87115f6dbabd198beee@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3e7e9b90$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,84da031bf63d5910
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2003-03-23 22:38:57 PST
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: StringReplace function
Date: Mon, 24 Mar 2003 01:34:46 -0500
Message-ID: <MPG.18e87115f6dbabd198beee@newsgroups.borland.com>
References: <3e7e9b90$1@newsgroups.borland.com>
X-Newsreader: MicroPlanet Gravity v2.60
NNTP-Posting-Host: 151.197.230.151
X-Trace: newsgroups.borland.com 1048487690 151.197.230.151 (23 Mar 2003 22:34:50 -0800)
Lines: 21
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!diablo.theplanet.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail