wcsstr - C wchar.h

C examples for wchar.h:wcsstr

Type

function

From


<cwchar>
<wchar.h>

Description

Locate substring of wide string

Prototype

const wchar_t* wcsstr (const wchar_t* wcs1, const wchar_t* wcs2);
      wchar_t* wcsstr (      wchar_t* wcs1, const wchar_t* wcs2);

Parameters

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

Return Value

A pointer to the first found character in wcs1, or a null pointer if the sequence is not present in wcs1.

Demo Code


#include <wchar.h>

int main ()//from www.  j a v  a2 s  . c  o  m
{
  wchar_t wcs[] = L"This is a simple string";
  wchar_t * pwc;
  pwc = wcsstr (wcs,L"simple");
  wcsncpy (pwc,L"sample",6);
  wprintf (L"%ls\n",wcs);
  return 0;
}

Related Tutorials