bring in EXAMPLES from openbsd.
This commit is contained in:
parent
fd80262662
commit
049fa38b0c
@ -34,9 +34,9 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" from: @(#)strcspn.3 8.1 (Berkeley) 6/4/93
|
||||
.\" $NetBSD: strcspn.3,v 1.6 2002/02/07 07:00:32 ross Exp $
|
||||
.\" $NetBSD: strcspn.3,v 1.7 2002/08/11 07:50:04 yamt Exp $
|
||||
.\"
|
||||
.Dd June 4, 1993
|
||||
.Dd August 11, 2002
|
||||
.Dt STRCSPN 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -68,6 +68,20 @@ The
|
||||
.Fn strcspn
|
||||
function
|
||||
returns the number of characters spanned.
|
||||
.Sh EXAMPLES
|
||||
The following call to
|
||||
.Fn strcspn
|
||||
will return 3, since the first three characters of string
|
||||
.Fa s
|
||||
do not occur in string
|
||||
.Fa charset :
|
||||
.Bd -literal -offset indent
|
||||
char *s = "foobar";
|
||||
char *charset = "bar";
|
||||
size_t span;
|
||||
|
||||
span = strcspn(s, charset);
|
||||
.Ed
|
||||
.Sh SEE ALSO
|
||||
.Xr index 3 ,
|
||||
.Xr memchr 3 ,
|
||||
|
Loading…
Reference in New Issue
Block a user