title: Extract string between by [" "]
body: <p>how can I extract string between <code>[" "]</code>
  I have eg: <code>["x"]</code>, so how can I extract just <code>x</code> and assign it to a 
  variable
  I have tried this:</p>
  
  <pre><code>String str = "[x]";    
  String result = str.substring(str.indexOf("[") + 1, str.indexOf("]"));
  </code></pre>
  
  <p>I can get x using the above code but my string is enclosed between <code>[" "]</code></p>