al_ustr_find_replace_cstr(3alleg5)

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

✨ NAME ✨

al_ustr_find_replace_cstr β€” it's giving Allegro 5 API energy πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

bool al_ustr_find_replace_cstr(ALLEGRO_USTR *us, int start_pos,
   const char *find, const char *replace)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay bestie so listen β€” this is literally al_ustr_find_replace(3alleg5) but make it C-string. That's it, that's the whole vibe 🫢

The difference? Instead of fancy ALLEGRO_USTR objects for the find and replace bits, you're handing it plain old C-style strings. Same energy, less overhead, no cap ✨

So when you call it you're passing:

  • us β€” your ALLEGRO_USTR *, the main character of this whole operation πŸ‘‘
  • start_pos β€” an int, where in the string we start looking πŸ”
  • find β€” a const char *, the C-style string you wanna hunt down
  • replace β€” a const char *, the C-style string you wanna swap in

And it hands you back a bool β€” true or false, iconic, no notes πŸ’–

not me telling you to peek at al_ustr_find_replace(3alleg5) if you want the full tea on how the searching and replacing actually goes down β€” this one is the C-string flavoured twin, periodt πŸ’€

Allegro reference manual 🌈 and yeah this gorgeous little page is from al_ustr_find_replace_cstr(3alleg5) β€” mwah, slay, go forth and replace some strings bestie πŸŽ€πŸ’œ

πŸ“¦ where this page comes from