title: Replace last occurrence only in a string
body: <p>I have the following string:</p>
  
  <pre><code>s = 'JSON, XML, XLS, XLSX, CSV, TSV'
  </code></pre>
  
  <p>I would like to convert it to have an "and" at the end. Is it possible to do a <code>replace</code> operation only at the last occurrence of something, such as:</p>
  
  <pre><code>s.replace(', ', ', and ', -1)
  </code></pre>
  
  <p>==> </p>
  
  <pre><code>'JSON, XML, XLS, XLSX, CSV, and TSV'
  </code></pre>