I believe you have to write your own replace:

   //
   // replace
   //
   // Replaces every occurrence of oldStr in s with newStr.
   //
   // Parameters:
   //    s:      The String to perform the replacement on
   //    oldStr: The substring to be replaced
   //    newStr: The substring to replace with
   //
   public String replace(String s, String oldStr, String newStr)
   {
      int pos = s.indexOf(oldStr);

      while (pos != -1) {
         s = s.substring(0, pos) + newStr +
                                    s.substring(pos + oldStr.length());
         pos = s.indexOf(oldStr, pos + newStr.length());
      }
      return s;

   }

-----Original Message-----
From: srinivasa rao yeramati [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 01, 2000 12:03 AM
To: [EMAIL PROTECTED]
Subject: Urgent : how to replace multiple occurances of a character in a
string


Hi

I have to replace the occurance of single quote ' with two single quotes ''
in multipe places with in the same string .
How can i replace multiple ocurances. is replace method has any parameters
to take care.

Help is highly appreciated

srini yeramati


________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to