diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 1999-06-04 16:30:02 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 1999-06-04 16:30:02 +0000 |
commit | ae132c1395eedb1fb53d3ecef51a5a352c81d31e (patch) | |
tree | 71db392df91bdbbb10acca6f83a0d257ddaf7487 /lib/libc | |
parent | 47c0e4c8e63846e5e7e1d4ba0b5fa2425209a162 (diff) |
add an example; pattonme@ns.ra.pae.osd.mil
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/string/strspn.3 | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libc/string/strspn.3 b/lib/libc/string/strspn.3 index 7d15470dee0..f8834dfecc0 100644 --- a/lib/libc/string/strspn.3 +++ b/lib/libc/string/strspn.3 @@ -33,7 +33,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: strspn.3,v 1.3 1996/08/19 08:34:25 tholo Exp $ +.\" $OpenBSD: strspn.3,v 1.4 1999/06/04 16:30:01 aaron Exp $ .\" .Dd June 29, 1991 .Dt STRSPN 3 @@ -60,6 +60,20 @@ The .Fn strspn function returns the number of characters spanned. +.Sh EXAMPLES +The following call to +.Fn strspn +will return 3, since the first three characters of string +.Fa s +are part of string +.Fa charset : +.Bd -literal -offset indent +char *s = "foobar"; +char *charset = "of"; +size_t span; + +span = strspn(s, charset); +.Ed .Sh SEE ALSO .Xr index 3 , .Xr memchr 3 , |