al_ustr_has_prefix_cstr(3)
β¨ al_ustr_has_prefix_cstr(3) β¨
okay so bestie, this one's from the Library Functions Manual and it's literally the easiest little vibe check in the whole Allegro 5 API β like, we're checking if a string starts with another string, that's it, that's the whole thing π
πΈ NAME πΈ
al_ustr_has_prefix_cstr β the Allegro 5 API function that tells you whether your ALLEGRO_USTR starts with a plain C string π
π¦ SYNOPSIS π¦
#include <allegro5/allegro.h>
bool al_ustr_has_prefix_cstr(const ALLEGRO_USTR *us1, const char *s2)
like, you give it a const ALLEGRO_USTR * called us1, you give it a const char * called s2, and it hands you back a bool. periodt β¨
π DESCRIPTION π
Returns true iff us1 begins with s2. π«Ά
not "if it contains it", not "if it ends with it" β begins with, bestie. it's a prefix check, it's giving very specific main character energy, and it's returning true iff that prefix situation is real. anything else? false. ngl that's the whole function and honestly? obsessed π
π SEE ALSO π
al_ustr_has_prefix(3)β same energy, different signature πal_ustr_has_suffix_cstr(3)β the one that checks the end instead, iconic in its own way π
π reminder: it checks whetherus1begins withs2β don't come for me if you were expecting suffix behaviour, that's the other function's job π§
and that's the page!! this cutie lives in the Allegro reference manual, filed under al_ustr_has_prefix_cstr(3) β catch you in the next one, mwah ππ
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms