diff options
Diffstat (limited to 'lib/libc/string/strcspn.3')
-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 , |