学习 csting::find

CString::Find

编辑本段作用

在一个较大的字符串中查找字符或子字符串

int Find( TCHAR ch ) const;

int Find( LPCTSTR lpszSub ) const;

int Find( TCHAR ch, int nStart ) const;

int Find( LPCTSTR lpszSub, int nStart ) const;

编辑本段返回值

返回此CString对象中与需要的子字符串或字符匹配的第一个字符的从零开始的索引;如果没有找到子字符串或字符则返回-1。

编辑本段参数

ch 要搜索的单个字符。

lpszSub 要搜索的子字符串。

nStart 字符串中开始搜索的字符的索引,如果是0,则是从头开始搜索。如果nStart不是0,则位于nStart之前的字符不包括在搜索之内。

pstr 指向要搜索的字符串的指针

posted @ 2011-12-20 11:26  os66  阅读(285)  评论(0编辑  收藏  举报