Hey, I was wondering how you detect white space in strings? I will throw some code at you and if you could, tell me what I'm doing wrong or what I'm not doing.


int main()
{
string foo = " ";

if(foo.compare(" "))
{
cout << "It worked" << endl;
}

return (0);
}


Any ideas?