find_first_not_of

#include <string>  

 size_type find_first_not_of(const string &str,size_type index =0 )const;

  size_type find_first_not_of(const Char* str,size_type index =0 )const;  

 size_type find_first_not_of(const Char* str,size_type index,size_type num )const;  

 size_type find_first_not_of(Char ch,size_type index =0 )const;  

 函数find_first_not_of()功能如下:

  1.返回在字符串中首次出现的不匹配str任何字符的首字符索引, 从index开始搜索, 如果全部匹配则返回string::npos。  

 2.从index开始起搜索当前字符串, 查找其中与str前num个字符中的任意一个都不匹配的序列, 返回满足条件的第一个字符索引, 否则返回string::npos。  

 3.返回在当前字符串中第一个不匹配ch字符的索引, 从index开始搜索, 没用收获则返回string::npos。


posted @ 2012-11-07 16:23  MFT  阅读(237)  评论(0编辑  收藏  举报