I want to check if a char (string.at(i)) is whitespace in C++. How can I do this easily?
I got this code example, and I was thinking to change the _____ with something, but don't know what. I've tried with ' ', but that didn't work.
for(int i = 0; i < string.length(); i++)
{
if(string.at(i) == _________)
{
//do something
}
}
#include <cctype>
if (isspace(string.at(i)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With