Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) FindString

 

Find a std::string in a std::string.

 

#include <cassert>
#include <string>

int main ()
{
  const std::string searchme = "BILDERBIKKEL WAS HERE";
  assert(searchme.find("BILDERBIKKEL") != std::string::npos);
  assert(searchme.find("RICHEL") == std::string::npos);
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict