title: How do you use string.erase and string.find?
body: <p>Why cant i call string.find in string.erase like so: <code>str.erase(str.find(a[1]),str.size())</code>?
  edit:code added</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  // html tags
  string tags[5]={"&lt;!--...--&gt;","&lt;!DOCTYPE&gt;","&lt;a&gt;","&lt;abbr&gt;","&lt;acronym&gt;"};
  //
  
  //check if string exists
  int boolStringExists(string a, string b)
  {
      if(a.find(b)&gt;0)
      {
          return 1;
      }
      if(a.find(b)&lt;=0)
      {
          return 0;
      }
  
  }
  //erase tag from string a
  void eraseTags(string a,string b[])
  {
  
      for(int i=0; i&lt;5;i++)
      {
          int x=(boolStringExists(a,b[i]));
          while (x&gt;0)
          {
              a.erase(a.find(b[i]),b[i].size());
              x=(boolStringExists(a,b[i]));
          }
      }
  }
  int _tmain(int argc, _TCHAR* argv[])
  {    
      fstream file;
      file.open("h:\\a.htm");
      string k,m;
  
  
  
      while(getline(file, k))
          m += k ;
  
  
      eraseTags(m,tags);
  
  
      return 0;
  }
  </code></pre>
  
  <p>Gives this message: "this application has requested  the runtime to terminate it in an unusual way.Please contact the application's  support team for more information."</p>