title: C++ string equivalent for strrchr
body: <p>Using C strings I would write the following code to get the file name from a file path:</p>
  
  <pre><code>#include &lt;string.h&gt;
  
  const char* filePath = "dir1\\dir2\\filename"; // example
  // extract file name (including extension)
  const char* fileName = strrchr(progPath, '\\');
  if (fileName)
    ++fileName;
  else
    fileName = filePath;
  </code></pre>
  
  <p>How to do the same with C++ strings? (i.e. using <code>std::string</code> from <code>#include &lt;string&gt;</code>)</p>