SDL_wcsstr(3)

✨ SDL_wcsstr ✨

okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages πŸ’– today we're looking at SDL_wcsstr, and honestly? it's giving "find my ex's name in the group chat" energy. let's go πŸ¦‹


🌸 NAME 🌸

SDL_wcsstr β€” search a wide string for the first instance of a specific substring. no cap, that's literally the whole job πŸ’…


✨ SYNOPSIS ✨

#include <SDL3/SDL_stdinc.h>

wchar_t * SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle);

πŸ’œ DESCRIPTION πŸ’œ

so here's the vibe: the search ends once it finds the requested substring, or a null terminator byte that ends the string. whichever comes first, bestie, and then it's done πŸŽ€

important note β€” this looks for strings of _wide characters_, not _codepoints_. so it is legal to search for malformed and incomplete UTF-16 sequences. yes fr fr, no judgement, it'll do it πŸ™ˆ


🫢 FUNCTION PARAMETERS 🫢

  • haystack β€” the wide string to search. Must not be NULL. like, genuinely, don't. 😭
  • needle β€” the wide string to search for. Must not be NULL. same deal, bestie, we're not doing that πŸ’€

πŸ‘‘ RETURN VALUE πŸ‘‘

returns a pointer to the first instance of needle in the string, or NULL if not found. that's it, that's the whole tea β˜•


🌈 THREAD SAFETY 🌈

it is safe to call this function from any thread. main character energy across the board, she's not picky πŸ’–


⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. so if you're on anything older, sorry babe, no SDL_wcsstr for you πŸŽ€


and that's the whole page, bestie!! you ate this one, honestly πŸ“

this little love letter comes to you from Simple Directmedia Layer, SDL 3.4.18, straight out of the SDL_wcsstr(3) manual. mwah πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from