String modification

Hi,

I got one situation when working with java.lang.String. I would like to explain with one simple example so that I can be clear.

originalString= "HANDICRAFTS (MADE OF BRASS, COPPER, IRON, WOOD, BAMBOO, WICKER, PAPER, PAPER MACHE, LEATHER, )".

I would like to replace the set of characters "ER" with "RE" whereever it occurs. so the o/p string like

" HANDICRAFTS (MADE OF BRASS, COPP"-->RE<--", IRON, WOOD, BAMBOO, WICK"-->RE<--", PAP"-->RE<--", PAP"-->RE<--" MACHE, LEATH"-->RE<--",)".

like this.

Note:- There is a function called java.lang.String.replaceAll(String str1,String str2) in jdk1.4. But I need to work on jdk1.3 where this method is not supported.So I request you all to help with the sample code of that logic.

Thank you.

[825 byte] By [anirudh_r] at [2007-9-30 4:20:48]
# 1
http://onesearch.sun.com/search/developers/index.jsp?qt=1.3+replaceall&col=devforums
ChuckBing at 2007-7-1 12:39:23 > top of Java-index,Administration Tools,Sun Connection...