Export (0) Print
Expand All
div
eof
Expand Minimize

_mbsspnp, _mbsspnp_l, _strspnp, _wcsspnp 

Returns a pointer to the first character in a given string that is not in another given string.


unsigned char *_mbsspnp(
   const unsigned char *str,
   const unsigned char *charset
);
unsigned char *_mbsspnp_l(
   const unsigned char *str,
   const unsigned char *charset,
   _locale_t locale
);
char *_strspnp(
   const char *str,
   const char *charset
);
wchar_t *_wcsspnp(
   const unsigned wchar_t *str,
   const unsigned wchar_t *charset
);

Parameters

str

Null-terminated string to search.

charset

Null-terminated character set.

locale

Locale to use.

_strspnp, _wcsspnp, and _mbsspnp return a pointer to the first character in str that does not belong to the set of characters in charset. Each of these functions returns NULL if str consists entirely of characters from charset. For each of these routines, no return value is reserved to indicate an error.

The _mbsspnp function returns a pointer to the multibyte character that is the first character in str that does not belong to the set of characters in charset. _mbsspnp recognizes multibyte-character sequences according to the multibyte code page currently in use. The search does not include terminating null characters.

If either str or charset is a null pointer, this function invokes the invalid parameter handler, as described in Parameter Validation. If execution is allowed to continue, the function returns NULL and sets errno to EINVAL.

Generic-Text Routine Mappings
Tchar.h routine _UNICODE and _MBCS not defined _MBCS defined _UNICODE defined

_tcsspnp

_strspnp

_mbsspnp

_wcsspnp

_strspnp and _wcsspnp are single-byte character and wide-character versions of _mbsspnp. _strspnp and _wcsspnp behave identically to _mbsspnp otherwise; they are provided only for this mapping and should not be used for any other reason. _mbsspnp_l is identical except that it uses the locale parameter passed in instead. For more information, see Using Generic-Text Mappings and Generic-Text Mappings.

Routine Required header Compatibility

_mbsspnp

<mbstring.h>

Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2003

_strspnp

<tchar.h>

Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2003

_wcsspnp

<tchar.h>

Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2003

For more compatibility information, see Compatibility in the Introduction.

// crt_mbsspnp.c
#include <mbstring.h>
#include <stdio.h>

int main( void ) {
   const unsigned char string1[] = "cabbage";
   const unsigned char string2[] = "c";
   unsigned char *ptr = 0;
   ptr = _mbsspnp( string1, string2 );
   printf( "%s\n", ptr);
}

abbage

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

Community Additions

ADD
Show:
© 2014 Microsoft