al_ustr_rtrim_ws(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

✨ al_ustr_rtrim_ws(3) ✨

okay so bestie, this one's from the Allegro 5 API and it's genuinely so useful β€” it's giving "little function, big main character energy" πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro5/allegro.h>

bool al_ustr_rtrim_ws(ALLEGRO_USTR *us)

🌸 DESCRIPTION 🌸

So the vibe here is: you've got a string, and it's got all this extra whitespace hanging off the right end (that's the trailing side, bestie β€” the end of the string, the "right" trim) and you want it gone. That's literally the whole job.

It removes all those trailing ("right") whitespace characters from the string, and the definition of "whitespace" is exactly whatever the C function isspace() says it is. So don't come at it with your own opinion about what counts as space β€” isspace() is the authority here, periodt 🌈

Also it returns a bool, so:

  • true when it worked πŸ’–
  • false when there was an error 😭

Like, it tells you how it went. Communication icon behavior, honestly 🫢

ngl this is the right-side-only sister of the trim functions β€” it does not touch the front of your string. Do not expect it to. She has a specific job.

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie πŸ¦‹ no cap, it's a short one β€” this little diva clocks in, trims the trailing whitespace, tells you true or false, and leaves. iconic.

πŸ’œ this was the Allegro reference manual, al_ustr_rtrim_ws(3) β€” mwah, go trim something πŸ’…

πŸ“¦ 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