public static String escapeString ( String value , boolean noBackslashEscapes ) { if ( ! value . contains ( "'" ) ) { if ( noBackslashEscapes ) { return value ; } if ( ! value . contains ( "\\" ) ) { return value ; } } String escaped = value . replace ( "'" , "''" ) ; if ( noBackslashEscapes ) { return escaped ; } return escaped . replace ( "\\" , "\\\\" ) ; }
Escape String .