code: public static String dequote(String str, int begin, int end, char quote)
      {
          // Is there anything to dequote?
          if (begin == end)
          {
              return "";
          }
  
          int endInt = str.indexOf(quote, begin);
  
          // If no quotes, return the original string
          // and save StringBuilder allocation/char copying
          if (endInt < 0)
          {
              return str.substring(begin, end);
          }
  
          StringBuilder sb     = new StringBuilder(end - begin);
          int          beginInt = begin; // need begin later
          do
          {
              if (((endInt + 1) >= end) || (str.charAt(endInt + 1) != quote))
              {
                  throw new IllegalArgumentException(
                      "Internal quote not doubled in string '"
                      + str.substring(begin, end) + "'");
              }
  
              sb.append(substring(str, beginInt, endInt)).append(quote);
              beginInt = endInt + 2;
              endInt = str.indexOf(quote, beginInt);
          }
          while ((endInt >= 0) && (endInt < end));
  
          return sb.append(substring(str, beginInt, end)).toString();
      }
docs: Undoubles the quotes inside a substring <br> Example:<br>
  <pre>
  hello""world becomes hello"world
  </pre>
  WARNING: scan for quote may continue to the end of the string, make sure
  that either <code>charAt(end + 1) == quote</code> or <code>end =
  str.lentgth()</code>. If in doubt call
  <code>dequote(str.substring(begin, end), quote)</code>
  
  @param str input string from which to get the substring, must not be
  null
  @param begin begin index for substring
  @param end end index for substring
  @param quote the quoting char
  
  @return dequoted string
  
  @throws IllegalArgumentException if string is incorrectly quoted