C examples for wchar.h:wcspbrk
function
<cwchar> <wchar.h>
Locate characters in wide string
const wchar_t* wcspbrk (const wchar_t* wcs1, const wchar_t* wcs2); wchar_t* wcspbrk ( wchar_t* wcs1, const wchar_t* wcs2);
Parameter | Description |
---|---|
wcs1 | C wide string to be scanned. |
wcs2 | C wide string containing the characters to match. |
the first occurrence in wcs1 of any of the wide characters in wcs2.
A null pointer if not found.
#include <wchar.h> int main ()/*from w w w.ja v a 2s . com*/ { wchar_t wcs[] = L"This is a sample wide string"; wchar_t key[] = L"aeiou"; wchar_t * pwc; wprintf (L"Vowels in '%ls': ",wcs); pwc = wcspbrk (wcs, key); while (pwc != NULL) { wprintf (L"%c " , *pwc); pwc = wcspbrk (pwc+1,key); } wprintf (L"\n"); return 0; }