uremove(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– uremove(3) πŸ’–

okay bestie so this is uremove, straight out of the Allegro manual β€” yes, the Allegro game programming library, the one that makes your lil game go brrr ✨


🌸 NAME 🌸

uremove β€” removes a character from a string. Allegro game programming library. that's the whole vibe πŸŽ€


✨ SYNOPSIS ✨

#include <allegro.h>

int uremove(char *s, int index);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” uremove takes the character sitting at the index you gave it, inside the string, and yeets it into the void. but it's not messy about it, no no. it slides the rest of the data back to fill the gap, so there's no lil hole left behind. clean. iconic. main character energy πŸ’…

and plot twist πŸ‘€ β€” if index is negative, it counts backward from the end of the string instead. so -1 is the last character, -2 is the one before that, you get it, iykyk 🫢

like for example, here's the vibe:

int length_in_bytes = ustrsizez(text_string);
...
length_in_bytes -= uremove(text_string, -1);

literally just chomping the last char off and keeping your byte count honest πŸ˜­πŸ’–


⭐ RETURN VALUE ⭐

it hands you back the number of bytes by which the trailing part of the string was moved β€” so you know exactly how much stuff shifted over. no cap, that's genuinely useful for keeping your lengths straight 🧚


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, they're all in the same friend group fr fr πŸ’œ


mwah πŸŽ€ that's a wrap, bestie β€” this was page uremove(3) from Allegro, version 4.4.3, and it's been a whole delight πŸ’– slay responsibly βœ¨πŸŒˆπŸ¦‹

πŸ“¦ where this page comes from