ctype::scan_not

Locates the first character in a range that does not match a specified mask.

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

Parameters

  • maskVal
    The mask value not to be matched by a character.

  • first
    A pointer to the first character in the range to be scanned.

  • last
    A pointer to the character immediately following the last character in the range to be scanned.

Return Value

A pointer to the first character in a range that does not match a specified mask. If no such value exists, the function returns last.

Remarks

The member function returns do_scan_not(maskVal, first, last).

Example

// 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;
}
First nonalpha character is "," at position: 5

Requirements

Header: <locale>

Namespace: std

See Also

Reference

ctype Class

Other Resources

ctype Members