al_ustr_remove_range(3alleg5)

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

✨ NAME ✨

al_ustr_remove_range β€” the Allegro 5 API glow-up where you just… yeet a whole chunk out of a string πŸ’…

(also hi bestie, this is page al_ustr_remove_range(3alleg5) from the Allegro reference manual, and we're gonna get you fluent, fr fr)


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

bool al_ustr_remove_range(ALLEGRO_USTR *us, int start_pos, int end_pos)

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: you've got a string, and there's a little slice of it that simply has to go. That's literally the whole job of al_ustr_remove_range. It removes the interval [start_pos, end_pos) from a string. πŸŽ€

Heads up on the brackets, bestie, this is not a vibe check you can skip: the interval is half-open. start_pos is in, end_pos is out. So the byte at end_pos stays put β€” it does not get deleted. Periodt. πŸ’€

Now, start_pos and end_pos are byte offsets β€” bytes, not characters, no cap. Remember that.

And here's the freedom part: both of them may be past the end of the string. Like, go ahead and overshoot, the function can handle it. 🌈 But β€” and this is the one hard limit β€” neither one cannot be less than 0 (the start of the string). Zero is the floor. Below zero is not it. πŸ™ˆ

So what does it give you back? A bool, obviously:

  • true β€” success, we ate, the range is gone πŸ”₯
  • false β€” error, it's giving struggle 😭

That's it. That's the whole function. Iconic, honestly. ✨


πŸ’– SEE ALSO πŸ’–


Allegro reference manual Β· al_ustr_remove_range(3alleg5) β€” okay bestie that's the whole page, ty for reading my little manpage essay, go forth and remove ranges responsibly, ily, mwah πŸ’œπŸ«Άβœ¨

πŸ“¦ where this page comes from