strsub man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

STRSUB(3)		     C Programmer's Manual		     STRSUB(3)

NAME
       strsub - substitute first occurence of pattern with another string

SYNOPSIS
       #include <publib.h>
       char *strsub(char *str, const char *pat, const char *sub);

DESCRIPTION
       strsub  finds  the first occurence of the pattern pat in the string str
       (using a method similar to strstr(3), i.e.,  no	regular	 expressions),
       and  replaces  it with sub.  If pat does not occur in str, no substituā€
       tion is made.

       Of course, if sub is an empty string, the pattern is deleted  from  the
       string.

RETURN VALUE
       strsub returns a pointer to the first character after the substitution,
       or NULL if no substitution was made.

EXAMPLE
       To substitute up to two occurences of "foo" with "bar" in a  line,  one
       might do the following.

	    p = strsub(line, "foo", "bar");
	    if (p != NULL)
		 strsub(line, "foo", "bar");

SEE ALSO
       publib(3), strstr(3), strgsub(3)

AUTHOR
       Lars Wirzenius (lars.wirzenius@helsinki.fi)

Publib			     C Programmer's Manual		     STRSUB(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net