Export (0) Print
Expand All
div
eof
Expand Minimize
This topic has not yet been rated - Rate this topic

_strspnp, _wcsspnp, _mbsspnp, _mbsspnp_l

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

Important note Important

_mbsspnp and _mbsspnp_l cannot be used in applications that execute in the Windows Runtime. For more information, see CRT functions not supported with /ZW.

char *_strspnp(
   const char *str,
   const char *charset
);
wchar_t *_wcsspnp(
   const unsigned wchar_t *str,
   const unsigned wchar_t *charset
);
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
);
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. For more information, see Using Generic-Text Mappings and Generic-Text Mappings.

_mbsspnp_l is identical except that it uses the locale parameter passed in instead. For more information, see Locale.

Routine

Required header

_mbsspnp

<mbstring.h>

_strspnp

<tchar.h>

_wcsspnp

<tchar.h>

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);
}

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.