For resolving this problem I use the following function
public static String replace(String text, String oldStr, String NewStr)
{
        int index=0;
        String Buffer = text;

        if (Buffer.equalsIgnoreCase ("")) return Buffer;

        while((index = Buffer.indexOf(oldStr, index)) >= 0)
        {
                Buffer = Buffer.substring(0,index)+ NewStr +
                                 Buffer.substring(index + OldStr.length());

                index += NewStr.length();
        }
        return Buffer;
}

Regards
Rinaldo Bonazzo
Resp.IT Sardinia Point
Tel. 0039070673178
Email [EMAIL PROTECTED]
web address www.sardiniapoint.it

-----Messaggio originale-----
Da: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]Per conto di
ananthakrishnan
Inviato: mercoledi 24 gennaio 2001 6.58
A: [EMAIL PROTECTED]
Oggetto: apostrophe


1) I tried placing an apostrophe before other and it works fine for sql
server
2) In oracle such replacements may not work hence my suggestion would be
to replace the apostrophe sign with its ascii equivalent and do database
operations

Anantha Krishnan
Software Engineer
Satyam

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to