I was just talking with a friend about what would be the most efficient way to check if a std::string has only spaces. He needs to do this on an embedded project he is worki
Why so much work, so much typing?
bool has_only_spaces(const std::string& str) { return str.find_first_not_of (' ') == str.npos; }