wcswcs -- Locate Wide-Character Substring

Format

#include <wcstr.h>
wchar_t *wcswcs(const wchar_t *string1, const wchar_t *string2);

Language Level: XPG4
wcswcs locates the first occurrence of string2 in the wide-character string pointed to by string1. In the matching process, wcswcs ignores the wchar_t null character that ends string2.

Return Value
wcswcs returns a pointer to the located string or NULL if the string is not found. If string2 points to a string with zero length, wcswcs returns string1.

Example
This example finds the first occurrence of the wide character string pr in buffer1.

#include <stdio.h>
#include <wcstr.h>
#define SIZE 40
int main(void)
{
  wchar_t buffer1[SIZE] = L"computer program";
  wchar_t * ptr;
  wchar_t * wch = L"pr";
  ptr = wcswcs( buffer1, wch );
  printf( "The first occurrence of %ls in '%ls' is '%ls'\n",
                          wch, buffer1, ptr );
  return 0;
  /******************************************************************
     The output should be:
     The first occurrence of pr in 'computer program' is 'program'
  ******************************************************************/
}


strchr -- Search for Character
strcspn -- Compare Strings for Substrings
strpbrk -- Find Characters in String
strrchr -- Find Last Occurrence of Character in String
strspn -- Search Strings
wcschr -- Search for Wide Character
wcscmp -- Compare Wide-Character Strings
wcscspn -- Find Offset of First Wide-Character Match
wcspbrk -- Locate Wide Characters in String
wcsrchr -- Locate Wide Character in String
wcsspn -- Search Wide-Character Strings
<wcstr.h>