al_ustr_ltrim_ws(3alleg5)

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

✨ 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 πŸ‘‘


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