Query: strdel
OS: debian
Section: 3pub
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
STRDEL(3pub) C Programmer's Manual STRDEL(3pub)NAMEstrdel - delete characters from beginning of stringSYNOPSIS#include <publib.h> char *strdel(char *s, size_t n);DESCRIPTIONstrdel removes the first n characters of s. If n is greater than the length of the string, all characters in the string (not counting ' ') are removed but no more.RETURN VALUEstrdel returns its first argument.EXAMPLETo change all occurences of "Pascal" in the input to "Yuck!", you might do the following: #include <string.h> #include <stdio.h> #include <publib.h> int main(void) { char line[512]; while (fgets(line, sizeof(line), stdio) != NULL) { while ((p = strstr(line, "Pascal")) != NULL) { strdel(p, 6); strins(p, "Yuck!"); } printf("%s", line); } return 0; }SEE ALSOpublib(3), strins(3)AUTHORLars Wirzenius (lars.wirzenius@helsinki.fi) Publib C Programmer's Manual STRDEL(3pub)
Related Man Pages |
---|
strcstr(3pub) - debian |
strsplit(3pub) - debian |
strsub(3pub) - debian |
strvars(3pub) - debian |
xmalloc(3pub) - debian |
Similar Topics in the Unix Linux Community |
---|
AWK - number of specified characters in a string |