al_ustr_ltrim_ws(3alleg5)
β¨ al_ustr_ltrim_ws β Allegro 5 API β¨
okay bestie, come sit with me, we're gonna talk about trimming. no not that kind of trimming π this is the Allegro 5 API and this lil function is genuinely so useful it's giving main character energy.
πΈ NAME πΈ
al_ustr_ltrim_ws β literally the "cut the blank space off the front" girlie of the Allegro 5 API π
π¦ SYNOPSIS π¦
#include <allegro5/allegro.h>
bool al_ustr_ltrim_ws(ALLEGRO_USTR *us)
like, that's it. one include, one call, one bool coming back at you. iconic.
π DESCRIPTION π
So here's the vibe: this function removes leading whitespace characters from a string, and "whitespace" here means whatever the C function isspace() says it is. no cap, that's the definition, we don't make the rules, C does.
It's the left trim, hence the l, so it's only eating the space at the front of your string, not the back. the back is somebody else's problem (hi al_ustr_rtrim_ws, we'll get to you).
It returns true on success, or false on error. that's the whole deal. short, sweet, slays. β¨
heads up bestie: that return value is not decoration. false means something went wrong, so maybe actually check it? just a thought π«Ά
π SEE ALSO π
al_ustr_rtrim_ws(3alleg5)β the right-side version, trims the trailing whitespace insteadal_ustr_trim_ws(3alleg5)β the both-sides-at-once version, the overachiever of the trio
and that's the whole page fr fr π this came out of the Allegro reference manual, and you just read the al_ustr_ltrim_ws(3alleg5) entry. go trim something. slay. πβ
π¦ 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