Removing leading and trailing double quotes in string in rails
<p>I want to trim the leading and trailing quotes of a string without any replacement.. I have tried with gsub.. but nothing helped.. I want to achieve something like., "hai" to hai</p>

<p>In Java, I ll use like the following., </p>

<pre><code>String a="\"hai";
String z=a.replace("\"", "");
System.out.println(z);
</code></pre>

<p>Output:</p>

<p>hai</p>

<p>How can I achieve this in rails? Kindly pls help..</p>

<p>In my irb</p>

<pre><code>2.2.3 :008 &gt; str = "\"hai"
  =&gt; "\"hai"
2.2.3 :009 &gt; str.tr!('\"', '')
  =&gt; "hai"
</code></pre>

<p>Why am I not able to get output without double quotes?? Sorry ., If my question doesn't meet your standard..</p>