How to replace substring with quotes in Java?
<p>I have a string:</p>

<pre><code>str="{\"type\":\"Polygon\",\"coordinates\":[[[60.677938980978993,56.834449959232998],
[60.680103564162927,56.834305549577387],[60.679971577383398,56.833005837614643],
[60.679813193248009,56.832846980836457],[60.678546120164683,56.832760331400671],
[60.678229351893869,56.831850500219574],[60.677622212708137,56.831893826015182],
[60.676830292031028,56.832139337910085],[60.67624955020122,56.832818097713471],
[60.676275947556981,56.833655699235088],[60.676328742268893,56.834724336044253],
[60.677411033860842,56.834695454369324],[60.677490225928629,56.834478841097273],
[60.677938980978993,56.834449959232998]]]}"
</code></pre>

<p>Now i want to delete all <code>\</code>:</p>

<pre><code>str.replaceAll("\\",""); 
</code></pre>

<p>And get error:</p>

<pre><code>java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
\
</code></pre>

<p>Okey i says. Another wish its delete first and last quotes:</p>

<pre><code>str.substring(str.indexOf("\""),str.lastIndexOf("\""));
</code></pre>

<p>And i get a string:</p>

<pre><code>"{\"type\":\"Polygon\",\"coordinates\":[[[60.677938980978993,56.834449959232998],
[60.680103564162927,56.834305549577387],[60.679971577383398,56.833005837614643],
[60.679813193248009,56.832846980836457],[60.678546120164683,56.832760331400671],
[60.678229351893869,56.831850500219574],[60.677622212708137,56.831893826015182],
[60.676830292031028,56.832139337910085],[60.67624955020122,56.832818097713471],
[60.676275947556981,56.833655699235088],[60.676328742268893,56.834724336044253],
[60.677411033860842,56.834695454369324],[60.677490225928629,56.834478841097273],
[60.677938980978993,56.834449959232998]]]"
</code></pre>

<p>Only last <code>}</code> was deleted.</p>

<p>What i doing wrong in this code snippets?</p>
