GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
STRDEL(3) C Programmer's Manual STRDEL(3)

strdel - delete characters from beginning of string

#include <publib.h>
char *strdel(char *s, size_t n);

strdel removes the first n characters of s. If n is greater than the length of the string, all characters in the string (not counting '\0') are removed but no more.

strdel returns its first argument.

To 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; }

publib(3), strins(3)

Lars Wirzenius (lars.wirzenius@helsinki.fi)
C Programmer's Manual Publib

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.