wchar_t *wcsnstr(const wchar_t *s1,
                 const wchar_t *s2,
                 size_t n);

wcsnstr searches at most n wide characters to locate the first occurrence in the wide string pointed to by s1 of the sequence of wide characters (excluding the terminating null wide character) in the wide string pointed to by s2.

wcsnstr returns a pointer to the located string, or a null pointer if the string is not found. If s2 points to a string with zero length, wcsnstr returns s1.


wcsnstr is an extension commonly found in Linux and BSD C libraries.