title: C++ std::string::find always returns npos?
body: <p>I'm trying to get this function to cut up a string, and then return it without whitespace and all lowercase. And to do this I'm trying to find a <code>" "</code> to see if a string, <code>"The Time Traveller (for so it will be convenient to speak of him)"</code>, contains a space. </p>
  
  <p>The code is as follows, passing in the string above to this function. It always returns <code>string::npos</code>. Any idea about the problem?</p>
  
  <pre><code>string chopstring(string tocut){
      string totoken = ""; 
      int start = 0;
      while(tocut[0] == ' ' || tocut[0] == 10 || tocut[0 == 13]){
          tocut.erase(0);
      }
      int finish = 0;
      finish = tocut.find(" ", start);
      if (finish == string::npos){
          cout &lt;&lt; "NPOS!" &lt;&lt; endl;
      }
      for (int i = start; i &lt; finish; i++){
          totoken += tocut[i];
      }
      tocut.erase(start, finish);
      return tokenize(totoken);
  }
  </code></pre>