From a75229263ddbca710a9fdffc776c5bfdad7c5dfe Mon Sep 17 00:00:00 2001 From: aaron <> Date: Fri, 4 Jun 1999 16:39:27 +0000 Subject: add an example, similar to the one in strspn.3 --- src/lib/libc/string/strcspn.3 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/libc/string/strcspn.3 b/src/lib/libc/string/strcspn.3 index 93c6d8f84c..de6aff5ebd 100644 --- a/src/lib/libc/string/strcspn.3 +++ b/src/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 , -- cgit v1.2.3-55-g6feb