您的位置:首页 > 编程语言 > C语言/C++

c++代码测试-std::string元素

2005-05-05 11:59 363 查看
//: c++代码测试
// std::string元素
std::string s = "mjk1MMM2122f999fg";
std::basic_string<char>::iterator it = s.begin();
locale loc;
for(; it != s.end(); it++){
if(isdigit(*it))
cout << *it;
else
if (::islower(*it))
cout << toupper(*it, loc);
else
cout << tolower(*it, loc);
}
cout << endl;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: