Here you can find the source of doubleQuote(String str)
public static String doubleQuote(String str)
//package com.java2s; /*/*ww w . j a v a2s .c om*/ * codjo.net * * Common Apache License 2.0 */ public class Main { public static String doubleQuote(String str) { int pos = str.indexOf('\''); if (pos != -1) { str = str.substring(0, pos + 1) + "'" + doubleQuote(str.substring(pos + 1)); } return str; } }