C examples for wchar.h:wcscspn
function
<cwchar> <wchar.h>
Get span until character in wide string
size_t wcscspn (const 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 number of wide characters in wcs1 before the first match.
#include <wchar.h> int main ()// ww w . ja v a 2 s . c o m { wchar_t wcs[] = L"this is a test 12"; wchar_t keys[] = L"1234567890"; int i; i = wcscspn (wcs,keys); wprintf (L"The first number in wcs is at position %d.\n",i+1); return 0; }