Standards / Extensions | C or C++ | Dependencies |
---|---|---|
ISO C Amendment |
both |
#include <wchar.h>
wchar_t *wcspbrk(const wchar_t *string1, const wchar_t *string2);
Locates the first occurrence in the string pointed to by string1 of any character from the string pointed to by string2.
The behavior of this wide-character function is affected by the LC_CTYPE category of the current locale. If you change the category, undefined results can occur.
If successful, wcspbrk() returns a pointer to the character.
If no wchar_t from string2 occurs in string1, wcspbrk() returns NULL.
⁄* CELEBW16
This example returns a pointer to the first occurrence in the
array string of either a or b, using &wcspbrk..
*⁄
#include <stdio.h>
#include <wchar.h>
int main(void)
{
wchar_t * result;
wchar_t * string = L"The 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);
}
The first occurrence of any of the characters "ab" in "The Blue Danube" is "anube"