uremove(3alleg4)

✨ uremove β€” the manual page, but make it cute ✨

okay so bestie, welcome to the Allegro manual, section 3, page uremove πŸŽ€ this one's from the Allegro game programming library and it's literally so simple you're gonna slay it.


🌸 NAME 🌸

uremove</purl> β€” Removes a character from a string. Allegro game programming library. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

int uremove(char *s, int index);

πŸ’– DESCRIPTION πŸ’–

so basically, uremove takes the character sitting at the index you give it inside the string, yeets it into the void πŸ—‘οΈβœ¨, and then slides all the rest of the data back to fill the gap. no holes left behind, no awkward silence, the string just closes ranks like a group chat after someone leaves. πŸ‘‘

and listen β€” if index is negative, it counts <em>backward from the end</em> of the string. so -1 is the last character, -2 is the one before that, you get it. iykyk. 🧚

Example, because seeing it is believing:

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

see how that works? chop the last char off, and subtract however many bytes got shuffled from your running length. chef's kiss. πŸ“


⭐ RETURN VALUE ⭐

It returns the number of bytes by which the trailing part of the string was moved. that's it, that's the number. no cap. πŸ”₯


🫢 SEE ALSO 🫢


πŸ’€ heads up bestie: index is just a raw index β€” uremove does not do bounds-checking magic for you, so know where you're pointing before you swing. πŸ™ˆ

okay that's the whole page, you ate it fr fr πŸ‘‘πŸ’– this was Allegro, version 4.4.3, manual page uremove(3alleg4) β€” go forth and remove some characters, main character energy only βœ¨πŸ¦‹πŸŽ€