Thanks Michael Dave
-----Original Message----- From: Michael Weissenbacher [mailto:[EMAIL PROTECTED]] Sent: 22 October 2001 10:51 To: '[EMAIL PROTECTED]' Subject: RE: Handling apostrophes call the following method like this String_Util.replace(value,"'","''"); public static String replace(String oldString, String toReplace, String replaceWith) { if(toReplace==null || toReplace.equals("") || oldString==null || oldString.equals("") || replaceWith==null) return oldString; StringBuffer sb=new StringBuffer(); int oldIndex=0; int newIndex=0; while((newIndex=oldString.indexOf(toReplace,oldIndex))!=-1) { sb.append(oldString.substring(oldIndex,newIndex)); sb.append(replaceWith); oldIndex=newIndex=newIndex+toReplace.length(); } sb.append(oldString.substring(oldIndex,oldString.length())); return sb.toString(); } michael
