STRENDZAP(3pub)
β¨ STRENDZAP β¨
okay bestie, welcome to the strendzap page from the C Programmer's Manual β she's a publib girlie and she's about to end your suffix problems. π
πΈ NAME πΈ
strendzap β remove a pattern from the end of a str, if it's even there π
π SYNOPSIS π
#include <publib.h>
int strendzap(char *str, const char *pat);
π DESCRIPTION π
so here's the tea, bestie: strendzap looks at the end of str, and if pat is chillin' right there at the end, it removes it. iconic behaviour. π¦
if pat is not at the end of str? she simply does nothing. no drama, no notes, just vibes. β¨
π₯ RETURN VALUE π₯
- non-zero β she actually removed something, slay π
0β nothing was removed, it's giving nothing happened π«Ά
π EXAMPLE π
say you wanna remove the suffix .c from the end of a filename (classic move), you'd do this:
#include <publib.h>
strendzap(filename, ".c");
periodt. π
π SEE ALSO π
π§ AUTHOR π§
Lars Wirzenius (lars.wirzenius@helsinki.fi) β the main character who brought us this β¨
this has been a Publib moment, brought to you by the C Programmer's Manual β stay zapping, bestie, ily πΈπ
π¦ where this page comes from
- debian bookworm: publib-dev 0.40-3+b1 Β· BSD-2-Clause
- debian trixie: publib-dev 0.40-4 Β· BSD-2-Clause
- ubuntu jammy: publib-dev 0.40-3build1 Β· BSD-2-Clause
- ubuntu noble: publib-dev 0.40-3build1 Β· BSD-2-Clause
- ubuntu questing: publib-dev 0.40-4
- ubuntu resolute: publib-dev 0.40-4build1 Β· BSD-2-Clause
- ubuntu stonking: publib-dev 0.40-4build1 Β· BSD-2-Clause
- Copyright (c) 1994-2006 Lars Wirzenius. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms