c 2b 2b check string is white space

Solutions on MaxInterview for c 2b 2b check string is white space by the best coders in the world

showing results for - "c 2b 2b check string is white space"
Laura
11 Nov 2020
1#include <cctype>
2#include <iostream>
3#include <cstring>
4
5using namespace std;
6
7int main()
8{
9    char str[] = "<html>\n<head>\n\t<title>C++</title>\n</head>\n</html>";
10
11    cout << "Before removing whitespace characters" << endl;
12    cout << str << endl << endl;
13
14    cout << "After removing whitespace characters" << endl;
15    for (int i=0; i<strlen(str); i++)
16    {
17        if (!isspace(str[i]))
18            cout << str[i];
19    }
20    
21    return 0;
22}