// 12判断string类型字符串是否为空
/*#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1 = "";
if(s1.empty()){
cout<<"s1为空"<<endl;
}else{
cout<<"s1不为空:"<<s1<<endl;
}
return 0;
*/
本文介绍如何使用C++的string类库判断一个字符串是否为空,并通过示例代码进行演示。
// 12判断string类型字符串是否为空
/*#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1 = "";
if(s1.empty()){
cout<<"s1为空"<<endl;
}else{
cout<<"s1不为空:"<<s1<<endl;
}
return 0;
*/
转载于:https://www.cnblogs.com/xiangxiaodong/archive/2012/09/24/2700708.html
857

被折叠的 条评论
为什么被折叠?