std::isspace
Header: <cctype>
Checks if the given character is whitespace character as classified by the currently installed C locale. In the default locale, the whitespace characters are the following:
# Declarations
int isspace( int ch );
# Parameters
ch: character to classify
# Return value
Non-zero value if the character is a whitespace character, zero otherwise.
# Notes
Like all other functions from
Similarly, they should not be directly used with standard algorithms when the iterator’s value type is char or signed char. Instead, convert the value to unsigned char first:
# Example
#include <cctype>
#include <climits>
#include <iomanip>
#include <iostream>
int main(void)
{
std::cout << std::hex << std::setfill('0') << std::uppercase;
for (int ch{}; ch <= UCHAR_MAX; ++ch)
if (std::isspace(ch))
std::cout << std::setw(2) << ch << ' ';
std::cout << '\n';
}