I use the regular expression package from Apache
http://jakarta.apache.org/regexp/index.html
and then I did:
RE expr = new RE("'") ; // RE is the class object from Apache
String newstr = expr.subst(oldstr, "''") ;
m: srinivasa rao yeramati <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
> reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Urgent : how to replace multiple occurances of a character in a
> string
>Date: Thu, 1 Jun 2000 04:03:14 IST
>
>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
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