c++如何判断一个字符串是否只有可见字符

  • Post author:
  • Post category:其他


#include<algorithm>

#include<boost/bind.hpp>

#include<cctype>

#include <string>

#include <iostream>

using   namespace   std;

int   main()

{

string   str=”Hello   World!1234567890~!@#$%^&*()_+|”;

char c = 150;

str += c;

if((find_if(str.begin(),str.end(),!bind(::isprint,_1)))==str.end())

cout<<“是”<<endl;

else   cout<<“不是”<<endl;

system(“PAUSE”);

return   0;

}