C examples for wchar.h:wcsspn
function
<cwchar> <wchar.h>
Get span of character set in wide string
size_t wcsspn (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 length of the initial portion of wcs1 containing only wide characters in wcs2.
If not found, the function returns zero.
#include <wchar.h> int main ()//from ww w . jav a 2 s . c o m { int i; wchar_t wcsText[] = L"test test test 129th"; wchar_t wcsSet[] = L"1234567890"; i = wcsspn (wcsText,wcsSet); wprintf (L"The initial number has %d digits.\n",i); return 0; }