Hi
What is the correct method for finding spaces in a text string??
Is it if(str[i] == NULL), if(str[i] == "") or if(str[i] == '')??
Printable View
Hi
What is the correct method for finding spaces in a text string??
Is it if(str[i] == NULL), if(str[i] == "") or if(str[i] == '')??
Code:if(str[i] == ' ')
Are you sure you want to use C?
Code:std::string str;
std::string::size_type pos = str.find(' ');
You can also use the isspace() function, which will check for tabs as well as spaces.