What is the proper way to use string::find to look for a word? [migrated]
- by RubyKing
How would I look through a string for a word rather then each character in that word. I have my code here and it always seems to find everything that is .obj even if its o or b or j or "." I checked the docuementation here but was unable to find an answer. Here is my code:
string &str = *it;
if(it->find(".obj"))
{
cout << "Found .Obj" << endl;
}
I also tried to use string::compare but that failed.