title: How to remove a particular substring from a string?
body: <p>In my C++ program, I have the string</p>
  
  <pre><code>string s = "/usr/file.gz";
  </code></pre>
  
  <p>Here, how to make the script to check for <code>.gz</code> extention (whatever the file name is) and split it like <code>"/usr/file"</code>?</p>