当前位置:在线查询网 > 在线百科全书查询 > find_first_not_of()

find_first_not_of()_在线百科全书查询


请输入要查询的词条内容:

find_first_not_of()


C++语言中string类对象的成员函数。

函数原型:

#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。

相关分词: find_first_not_of find first not of