al_ustr_find_chr(3alleg5)
β¨ 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 π
al_ustr_rfind_chr(3alleg5)β the same search but from the other direction, if you're feeling backwards today π
π 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
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms