title: How to limit search and replace string in mySQL
body: <p>I'm using this to search and replace strings in mySQL:</p>
  
  <pre><code>UPDATE products 
     SET prodname = REPLACE(prodname, " S", "'S")
  </code></pre>
  
  <p>The products contain strings such as "TYLENOL TABS 100 S" which I'd like to convert to "TYLENOL TABS 100'S".</p>
  
  <p>However, using the above SQL statement also affects strings such as "NIKE SHOES", which will become "NIKE'SHOES" -- which I obviously don't like.</p>
  
  <p>Is there a way I can limit the replace function (or is there another way to do this) so I can get the result I want? The " S" is usually at the tail end of the string for most of my data, which I'm hoping will be helpful.</p>