pro_jsp thread: Re: How to dealing with single quote ( ' ) and duoble- quote (
Hi Patrick
Try
(sorry about the standard of code)
StringBuffer b = new StringBuffer();
for (int i=0;i<descr.length();i++){
char c = descr.charAt(i);
if ((c=='\'')||(c=='\"')||(c=='\\')) {
b.append('\\');
}
b.append(c);
}
descr=b.toString();
descr is a String, just replace with your strings
Hope that helps
Tom
|





