The isspace() function is a part of the C++ standard library and is defined in the header file. This function is used to check whether a given character is a whitespace character or not.
The syntax of isspace() function is:
int isspace(int c);
Here, the parameter ācā is the ASCII value of the character to be checked.
Example 1: Check if a character is a whitespace character or not
#include #include
using namespace std;
int main() { char ch = ' ';
if (isspace(ch)) cout << "The character is a whitespace character" << endl; else cout << "The character is not a whitespace character" << endl;
Output: Original String: Hello, World! New String: Hello,World!
The package library used in these examples is .
C++ (Cpp) std::isspace - 24 examples found. These are the top rated real world C++ (Cpp) examples of std::isspace extracted from open source projects. You can rate examples to help us improve the quality of examples.