Syntax
#include <wchar.h> wchar_t *wcspbrk(const wchar_t *string1, const wchar_t *string2);Description
wcspbrk locates the first occurrence in the string pointed to by string1 of any wide character from the string pointed to by string2.
wcspbrk returns a pointer to the character. If string1 and string2 have no wide characters in common, wcspbrk returns NULL.
This example uses wcspbrk to find the first occurrence of either a or b in the array string.
#include <stdio.h>
#include <wchar.h>
int main(void)
{
wchar_t *result;
wchar_t *string = L"A Blue Danube";
wchar_t *chars = L"ab";
result = wcspbrk(string, chars);
printf("The first occurrence of any of the characters \"%ls\" in "
"\"%ls\" is \"%ls\"\n", chars, string, result);
return 0;
/****************************************************************************
The output should be similar to:
The first occurrence of any of the characters "ab" in "A Blue Danube"
is "anube"
****************************************************************************/
}
Related Information