ctype::scan_not
定位不在与指定的屏蔽的范围的第一个字符。
const CharType *scan_not(
mask maskVal,
const CharType* first,
const CharType* last,
) const;
参数
maskVal
掩码字符匹配的值。first
到第一个字符的指针将扫描的范围。last
为字符的指针。在将扫描范围的最后一个字符之后。
返回值
到第一个字符的指针不在与指定的屏蔽的范围。 如果这些值不存在,则函数返回 last。
备注
成员函数返回maskVal、do_scan_not( first,last)。
示例
// ctype_scan_not.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
using namespace std;
int main( )
{
locale loc1 ( "German_Germany" );
char *string = "Hello, my name is John!";
const char* i = use_facet<ctype<char> > ( loc1 ).scan_not
( ctype_base::alpha, string, string + strlen(string) );
cout << "First nonalpha character is \"" << *i << "\" at position: "
<< i - string << endl;
}
要求
页眉: <区域设置>
命名空间: std