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