al_ustr_find_chr(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ al_ustr_find_chr ✨

okay bestie, welcome to the Allegro 5 API πŸ’– this is the al_ustr_find_chr page, and yes it's exactly as iconic as it sounds. we're finding a character in a string. that's the whole vibe. let's go πŸ¦‹


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

int al_ustr_find_chr(const ALLEGRO_USTR *us, int start_pos, int32_t c)

like, that's the whole thing. one function. one glow-up. πŸ’…


πŸ’« DESCRIPTION πŸ’«

so here's the tea: you pass in us, start_pos, and c, and this function goes searching for the encoding of code point c inside us β€” starting at byte offset start_pos, and yes, that start point is inclusive (so the byte sitting right at start_pos counts too, no skipping, no gatekeeping 🫢).

then it just... tells you where it found it.

  • found it? slay πŸŽ€ you get back the position where it's chillin'.
  • didn't find it? -1. that's it. that's the answer. it's not there, bestie 😭

no cap, that's the whole function. short, sweet, does exactly one job and does it well. main character energy honestly πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€


πŸ’œ SIGN-OFF πŸ’œ

this lil masterpiece lives in the Allegro reference manual (page: al_ustr_find_chr(3alleg5)) β€” so yeah, that's the source, that's the version, that's the whole lineage. go forth and find your characters, bestie. periodt πŸ’…βœ¨πŸŒˆ

πŸ“¦ where this page comes from