diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 1999-06-04 16:39:28 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 1999-06-04 16:39:28 +0000 |
commit | 412c3d0b9e6062701f380fbd8e2f948eb3b5bf1b (patch) | |
tree | da31e2dc4d9c95307d3647191d533235f5e5abe0 /lib/libc | |
parent | 78e78a825319458cc9d2acfa918101f4f7f232a0 (diff) |
add an example, similar to the one in strspn.3
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/string/strcspn.3 | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libc/string/strcspn.3 b/lib/libc/string/strcspn.3 index 93c6d8f84cf..de6aff5ebd4 100644 --- a/lib/libc/string/strcspn.3 +++ b/lib/libc/string/strcspn.3 @@ -33,7 +33,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: strcspn.3,v 1.2 1996/08/19 08:34:14 tholo Exp $ +.\" $OpenBSD: strcspn.3,v 1.3 1999/06/04 16:39:27 aaron Exp $ .\" .Dd June 29, 1991 .Dt STRCSPN 3 @@ -65,6 +65,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 , |