code: public static String compressQuotes(String source, String quotes) {
          String result = source;
          int index;
  
          /* Find the first occurrence of adjacent quotes. */
          index = result.indexOf(quotes);
  
          /* Replace each occurrence with a single quote and begin the
           * search for the next occurrence from where we left off.
           */
          while (index != -1) {
              result = result.substring(0, index + 1)
                      + result.substring(index + 2);
              index = result.indexOf(quotes, index + 1);
          }
  
          return result;
      }
docs: Compress 2 adjacent (single or double) quotes into a single (s or d)
  quote when found in the middle of a String.
  
  NOTE:  """" or '''' will be compressed into "" or ''.
  This function assumes that the leading and trailing quote from a
  string or delimited identifier have already been removed.
  @param source string to be compressed
  @param quotes string containing two single or double quotes.
  @return String where quotes have been compressed