title: Replacing all occurrences of a pattern in a string
body: <p>Used to run R with numbers and matrix, when it comes to play with strings and characters I am lost. I want to analyze some data where the time is read into R as follow:</p>
  
  <pre><code>&gt;my.time.char[1]
  [1] "\"2011-10-05 15:55:00\"" 
  </code></pre>
  
  <p>I want to end up with a string containing only:</p>
  
  <pre><code>"2011-10-05 15:55:00"
  </code></pre>
  
  <p>Using the function sub() (that i barely understand...), I got the following result:</p>
  
  <pre><code>&gt; sub("(\")","",my.time.char[1])
  [1] "2011-10-05 15:55:00\""
  </code></pre>
  
  <p>This is closer to the format i am looking for, but I still need to get rid of the two last characters (<code>\"</code>).</p>