10 namespace string_utils
16 output.reserve(input.size());
20 for(; i < input.size(); ++i)
22 if(!std::isspace(static_cast<unsigned char>(input[i])))
26 bool in_space =
false;
28 for(; i < input.size(); ++i)
32 if(std::isspace(static_cast<unsigned char>(c)))
37 output.push_back(
' ');
49 for(
const char& c: input)
53 if(!std::isspace(static_cast<unsigned char>(c)))
std::string simplifyWhitespace(const std::string &input)
Compress any sequence of whitespace to single spaces.
bool isOnlyWhitespace(const std::string &input)
Check if string is whitespace only (includes ' ')