STRCHANGE(3pub)

πŸ’– NAME πŸ’–

okay so bestie, meet strchange β€” it replaces the beginning of a string with the beginning of another string. that's it, that's the whole serve. πŸ’…


✨ SYNOPSIS ✨

#include <publib.h>
char *strchange(char *str, size_t changelen,
                  const char *new, size_t newlen);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea, and it's actually pretty simple, no cap 🫢

strchange takes changelen characters from the beginning of str, and swaps them out for newlen characters from the beginning of new. like, the glow-up happens right at the front of the string.

and then? the rest of str gets moved appropriately so everything still fits together. the leftovers don't get abandoned, they just scoot over. iconic behavior honestly. 🧚


🌸 RETURN VALUE 🌸

strchange returns its first argument. yes, it hands you back str. it's giving "here's your string back, slightly edited, you're welcome." πŸ‘‘


🌈 SEE ALSO 🌈

go read those too bestie, they're in the same friend group fr fr.


πŸ’œ AUTHOR πŸ’œ

this masterpiece was written by Lars Wirzenius (lars.wirzenius@helsinki.fi). we stan. πŸŽ€


and that's the page!! this lil doc came to you courtesy of Publib and the C Programmer's Manual β€” STRCHANGE(3pub) forever and ever, periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from