title: How to remove a character in a variable of string type in R
body: <p>Hi dear I have a variable of this type in R:</p>
  
  <pre><code>v1
  CAR10100231095000C 
  CAR10100231189000 
  CAR10100231191000C 
  CAR10100231192000 
  CAR10100231194000C 
  CAR101002311950002 
  CAR101002311960001 
  </code></pre>
  
  <p>My problem is with rows that have a <code>C</code> as last element of the observation. I was trying to use <code>nchar()</code> function but I have others rows that have the same length for example <code>CAR10100231191000C</code>and CAR101002311960001. My problem is how to remove <code>C</code> from raws with this character and get a new variable of this form:</p>
  
  <pre><code>v1
  CAR10100231095000 
  CAR10100231189000 
  CAR10100231191000 
  CAR10100231192000 
  CAR10100231194000 
  CAR101002311950002 
  CAR101002311960001 
  </code></pre>
  
  <p>Where <code>Cs</code> were removed from rows that have and the rest of the rows have their original form. Thanks</p>