title: Find first character of string, then compare it with a symbol c++
body: <p>Attempting to check the first character of a string to see if it contains a "/".</p>
  
  <pre><code>string pathname = "/test";
  if(pathname.at(0) == "/")
  {
      // if first character is a slash then delete the slash
      // but only delete the slash if it's the first character
      pathname.erase(pathname.begin()+0);
  }
  </code></pre>
  
  <p>I understand that the above code will not work because pathname.at(0) is considered an int.</p>
  
  <p>I'm sure this has been asked before. But I have looked around a lot. I've seen the substr method the find method and many others. I can't seem to get them working right though. </p>
  
  <p>Suggestions? Thanks in advance.</p>