Remove Quotation mark from in between of the String but from 0th index and -1th index
<p>I want to remove quotation mark from this string:</p>

<pre><code>'"Hello World - October 1 Not Trending Twitter """"""""""""""""Spark 2, sparkCSV parser"""""""""""""""" - DDSAD"""""""""""'
</code></pre>

<p>Output should be</p>

<pre><code>'"Hello World - October 1 Not Trending Twitter Spark 2, sparkCSV parser - DDSAD"'
</code></pre>

<p>Any ideas?</p>

<p>Take the string and replace the <code>'"'</code> with <code>''</code>; then place them back in <code>'""'</code> with <code>'"{}"'.format</code>:</p>

<pre><code>s = '"Hello World - October 1 Not Trending Twitter """"""""""""""""Spark 2, sparkCSV parser"""""""""""""""" - DDSAD"""""""""""'
r = '"{}"'.format(s.replace('"', '')) 
</code></pre>

<p>Result being:</p>

<pre><code>'"Hello World - October 1 Not Trending Twitter Spark 2, sparkCSV parser - DDSAD"'
</code></pre>

<p>For your larger string as supplied in the comment, you could <code>split</code> on the <code>comma</code> and <em>then</em> join the formatted strings on the comma again:</p>

<pre><code>s = '"EM16203120","Hello World - October 1 Not Trending Twitter """"""""""""""""Spark 2, sparkCSV parser"""""""""""""""" - DDSAD"""""""""""'
r = ','.join('"{}"'.format(sb.replace('"', '')) for sb in s.split(','))
</code></pre>

<p>With <code>r</code> now being:</p>

<pre><code>'"EM16203120","Hello World - October 1 Not Trending Twitter Spark 2"," sparkCSV parser - DDSAD"'
</code></pre>

python string python-3.x