如题,我想查找字符串中某个字符,用find怎么做,在stl中。字符串如“姓名=张三”,我如何查找=
解决方案 »
- char[10]这样一个字符数组,可以直接和CString直接比较么?
- 苏轼念奴娇赤壁怀古鉴赏
- DataGrid 更新时如何控制编辑框输入的内容
- 请问高手:非API的DLL如何调用呀
- background and text color of a CDateTimeCtrl object ?
- 高分求助
- 如何实现在两个window窗口中Drag and drop
- mfc如何显示raw图像,打算把raw转成bmp的
- 我自己做的Custom AppWizard添加到了VC的AppWizard列表中,怎样删掉它呢?
- 迷宫问题:代码在VC2.0下编译通过,也可以自动绘制迷宫,为什么不现实答案,pach函数不起作用????
- [散分]要最后一跳了,骑驴找马的日子有点艰苦啊。
- 如何把一个框架窗口变成另一个框架窗口的子窗口,然后窗口的控件里?
std::string::find_first_ofstring str("姓名=张三");
string::size_type pos = str.find('=');
char *p=str;
char *q;
q=strstr(str,"=");
int i=q-p;
str.Find("=")
http://www.cplusplus.com/reference/string/string/find_first_not_of/
int Find( TCHAR ch ) const;
int Find( LPCTSTR lpszSub ) const;
int Find( TCHAR ch, int nStart ) const;
int Find( LPCTSTR pstr, int nStart ) const;CString str = "姓名=张三";
int iPos = str.Find("=");//iPos为4,Unicode 字符集下iPos为2
if(iPos == -1)//未找到
{ }
else
{ }