Export (0) Print
Expand All
Expand Minimize

_mbsspnp, _strspnp, _wcsspnp

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

unsigned char *_mbsspnp(
   const unsigned char *string1,
const unsigned char *string2 );

Parameters

string1
Null-terminated string to search.
string2
Null-terminated character set.

Return Value

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

Remarks

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

Generic-Text Routine Mappings

TCHAR.H routine _UNICODE & _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.

Requirements

Routine Required header Compatibility
_mbsspnp <mbstring.h> Win 98, Win Me, Win NT, Win 2000, Win XP
_strspnp <tchar.h> Win 98, Win Me, Win NT, Win 2000, Win XP
_wcsspnp <tchar.h> Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.

Libraries

All versions of the C run-time libraries.

Example

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

Output

abbage

See Also

String Manipulation Routines | strspn | strcspn | strncat | strncmp | strncpy | _strnicmp | strrchr | Run-Time Routines and .NET Framework Equivalents

Show:
© 2014 Microsoft