随笔分类 -  string

摘要:原文地址:http://www.java2s.com/Code/Cpp/Data-Type/StringFindandreplace.htm#include<string>#include<iostream>usingnamespacestd;intmain(){stringstr("abcabcabcdabcde");stringsearchString("hello");stringreplaceString("ab");assert(searchString!=replaceString);string: 阅读全文
posted @ 2011-09-04 20:21 wangkangluo1 阅读(254) 评论(0) 推荐(0) 编辑
摘要:原文地址:http://www.vimer.cn/2009/11/string%E6%9B%BF%E6%8D%A2%E6%89%80%E6%9C%89%E6%8C%87%E5%AE%9A%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%88c%EF%BC%89.html#include <string>#include <iostream>using namespace std;string replace_all(string str,const string old_value,const string new_value) { while(tru 阅读全文
posted @ 2011-08-16 11:14 wangkangluo1 阅读(2819) 评论(0) 推荐(0) 编辑
摘要:12原文链接:http://www.cppblog.com/ming81/archive/2012/09/26/192080.html相信使用过MFC编程的朋友对CString这个类的印象应该非常深刻吧?的确,MFC中的CString类使用起来真的非常的方便好用。但是如果离开了MFC框架,还有没有这样使用起来非常方便的类呢?答案是肯定的。也许有人会说,即使不用MFC框架,也可以想办法使用MFC中的API,具体的操作方法在本文最后给出操作方法。其实,可能很多人很可能会忽略掉标准C++中string类的使用。标准C++中提供的string类得功能也是非常强大的,一般都能满足我们开发项目时使用。现将 阅读全文
posted @ 2011-08-15 11:10 wangkangluo1 阅读(450) 评论(0) 推荐(0) 编辑
摘要:原文地址:http://www.cppblog.com/Darren/archive/2009/03/13/76474.html#include<string>//使用string类时须包含这个文件#include<iostream>usingnamespacestd;intmain(){stringstr1;//输入与输出cout<<"输入字符串str1"<<endl;cin>>str1;getchar();cout<<str1<<endl<<endl<<endl; 阅读全文
posted @ 2011-08-15 10:47 wangkangluo1 阅读(338) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示