1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
// isblank example (C++11)
#include <iostream> // std::cout
#include <string> // std::string
#include <locale> // std::locale, std::isblank
int main ()
{
std::locale loc;
std::string str="Example sentence to test isblank\n";
for (char c:str)
{
if (std::isblank(c,loc)) c='\n';
std::cout << c;
}
return 0;
}
|