Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#233558 - 15/09/2004 22:56 java question
image
old hand

Registered: 28/04/2002
Posts: 770
Loc: Los Angeles, CA
i'm trying to clean up some dirty data input before passing it on to another method.

the string in question is say, String s = "ST. JOHN%27%27S";

obviously, the %27%27 is actually supposed to be a '

but unfurtunately, s.replaceAll( "%27%27", "'");

no errors happen, but java doesn't seem to see that the pattern is in front of it's face. so, ultimately, i never get the desired effect. any suggestions?

Top
#233559 - 15/09/2004 23:47 Re: java question [Re: image]
mcomb
pooh-bah

Registered: 31/08/1999
Posts: 1649
Loc: San Carlos, CA
String.replaceAll() returns a modified copy of the String rather than doing an in place transformation so you need to do...

s = s.replaceAll( "%27%27", "'");

-Mike
_________________________
EmpMenuX - ext3 filesystem - Empeg iTunes integration

Top
#233560 - 16/09/2004 00:30 Re: java question [Re: mcomb]
image
old hand

Registered: 28/04/2002
Posts: 770
Loc: Los Angeles, CA
yeah, i was doing that. it turned out to be a routine AFTER i had read the cityname in that was adding the extra chars. duh. thanks for the help.

Top
#233561 - 16/09/2004 10:11 Re: java question [Re: image]
Cybjorg
addict

Registered: 23/12/2002
Posts: 652
Loc: Winston Salem, NC
Doh! I thought this thread was about coffee.

Top