al_ustr_rfind_chr(3alleg5)

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

🌸 NAME 🌸

al_ustr_rfind_chr β€” it's the Allegro 5 API, bestie, and this one is your backwards-search girly πŸ’…


✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

int al_ustr_rfind_chr(const ALLEGRO_USTR *us, int end_pos, int32_t c)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: you've got your us and you're looking for the encoding of code point c inside it, right? But here's the plot twist β€” you're not scrolling forward like a normal person, you're going BACKWARDS 🫢 starting from the byte offset end_pos, and that offset is exclusive, meaning it's not invited to the party, we skip right past it 😌

So you vibe-check your way backwards through the string and:

  • if it finds it β€” slay πŸ‘‘ β€” it returns the position where it is found
  • if it doesn't find it β€” tragic πŸ’€ β€” it returns -1

that's it, that's the whole function, she's simple but she ate πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘


and that's a wrap on this lil page, which came straight outta the Allegro reference manual (yes, the al_ustr_rfind_chr(3alleg5) one, iykyk) πŸ’– bye bestie, go find some code points backwards πŸŽ€

πŸ“¦ where this page comes from