Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Re: How to dealing with single quote ( ' ) and duoble- quote (


Message #1 by "Patrick Lane-Spollen" <patrick@b...> on Fri, 16 Feb 2001 16:06:36
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


  Return to Index