summaryrefslogtreecommitdiffstats
path: root/lib/libc/string
diff options
context:
space:
mode:
authoraaron <aaron@openbsd.org>1999-06-04 16:30:01 +0000
committeraaron <aaron@openbsd.org>1999-06-04 16:30:01 +0000
commit92726d6b171ea33913887a9043cf38be0b2b71fb (patch)
treec6d58b61dcfc1829d839f1f6ec44d8881c97f1d2 /lib/libc/string
parentBe consistent about the relaxation of invalid host name checking. (diff)
downloadwireguard-openbsd-92726d6b171ea33913887a9043cf38be0b2b71fb.tar.xz
wireguard-openbsd-92726d6b171ea33913887a9043cf38be0b2b71fb.zip
add an example; pattonme@ns.ra.pae.osd.mil
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/strspn.316
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 ,