wcscspn - C wchar.h

C examples for wchar.h:wcscspn

Type

function

From


<cwchar>
<wchar.h>

Description

Get span until character in wide string

Prototype

size_t wcscspn (const wchar_t* wcs1, const wchar_t* wcs2);

Parameters

Parameter Description
wcs1 C wide string to be scanned.
wcs2 C wide string containing the characters to match.

Return value

The number of wide characters in wcs1 before the first match.

Demo Code


#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;
}

Related Tutorials