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;
// 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;
相关文章推荐
- c++ std string reserve 测试
- [C++][代码共享]将UTF-8的std::string转换成std::wstring
- 【语言-C++】std:string 转换代码
- C++代码测试配置流程
- C++测试程序执行时间代码
- C++遍历中删除std::map元素
- C++线程同步 CCRITICALSECTION(临界区类)附自己写的测试代码
- 【代码片段】jQuery测试兄弟元素集合
- GoogleTest测试C++代码
- 白盒测试 [代码规范] [C++] 一
- C++测试代码(二)
- C++ 回调函数 实现 的测试代码
- 立此存照(17)[C++]error C2040: "s":"std::string"与"char [21]"的间接寻址级别不同
- 感兴趣的是里面的c++ 代码小测试程序
- 利用C++实现从std::string类型到bool型的转换
- c++测试代码时间
- C++中string、int常见类型转换(含代码演示)
- C++代码一次读取文本文件全部内容到string对象
- [C/C++标准库]_[初级]_[如何实现std::string自己的Format(sprintf)函数]
- [C/C++]_[初级]_[把一个图片的数据存入到std::string里,使用_wfopen生成二进制文件]