ctype::scan_not

指定したマスクに一致しない範囲の最初の文字を検索します。

const CharType *scan_not(
    mask maskVal, 
    const CharType* first, 
    const CharType* last,
) const;

パラメーター

  • maskVal
    文字が一致しない値のマスク。

  • first
    スキャン対象範囲の最初の文字へのポインター。

  • last
    スキャン対象範囲の最後の文字に続く文字へのポインター。

戻り値

指定したマスクに一致しない範囲の最初の文字へのポインター。このような値がない場合、関数は lastを返します。

解説

このメンバー関数は do_scan_not (maskVal、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;
}
  

必要条件

ヘッダー: <locale>

名前空間: std

参照

関連項目

ctype Class