找到第一个字符与指定的掩码范围。
const CharType *scan_is(
mask maskVal,
const CharType* first,
const CharType* last,
) const;
参数
maskVal
字符将与掩码值。first
对于第一个字符的指针在要浏览的范围。last
指向字符的指针在要浏览范围的最后一个字符之后。
返回值
对于第一个字符的指针在与指定的掩码范围。如果该值不存在,则函数返回 last.
备注
成员函数返回 do_scan_is(maskVal、first,last)。
示例
// ctype_scan_is.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_is
( ctype_base::punct, string, string + strlen(string) );
cout << "The first punctuation is \"" << *i << "\" at position: "
<< i - string << endl;
}
要求
标头: <locale>
命名空间: std