summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strspn.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/strspn.3')
-rw-r--r--src/lib/libc/string/strspn.330
1 files changed, 19 insertions, 11 deletions
diff --git a/src/lib/libc/string/strspn.3 b/src/lib/libc/string/strspn.3
index 4de03aa58b..ca965aeb18 100644
--- a/src/lib/libc/string/strspn.3
+++ b/src/lib/libc/string/strspn.3
@@ -33,8 +33,7 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" from: @(#)strspn.3 5.3 (Berkeley) 6/29/91 36.\" $OpenBSD: strspn.3,v 1.6 2000/04/21 15:24:20 aaron Exp $
37.\" $Id: strspn.3,v 1.1.1.1 1995/10/18 08:42:23 deraadt Exp $
38.\" 37.\"
39.Dd June 29, 1991 38.Dd June 29, 1991
40.Dt STRSPN 3 39.Dt STRSPN 3
@@ -48,9 +47,8 @@
48.Fn strspn "const char *s" "const char *charset" 47.Fn strspn "const char *s" "const char *charset"
49.Sh DESCRIPTION 48.Sh DESCRIPTION
50The 49The
51.Xr strcspn 50.Fn strspn
52function 51function spans the initial part of the null-terminated string
53spans the initial part of the null-terminated string
54.Fa s 52.Fa s
55as long as the characters from 53as long as the characters from
56.Fa s 54.Fa s
@@ -59,12 +57,23 @@ occur in string
59.Sh RETURN VALUES 57.Sh RETURN VALUES
60The 58The
61.Fn strspn 59.Fn strspn
62function 60function returns the number of characters spanned.
63returns the number of characters spanned. 61.Sh EXAMPLES
62The following call to
63.Fn strspn
64will return 3, since the first three characters of string
65.Fa s
66are part of string
67.Fa charset :
68.Bd -literal -offset indent
69char *s = "foobar";
70char *charset = "of";
71size_t span;
72
73span = strspn(s, charset);
74.Ed
64.Sh SEE ALSO 75.Sh SEE ALSO
65.Xr index 3 ,
66.Xr memchr 3 , 76.Xr memchr 3 ,
67.Xr rindex 3 ,
68.Xr strchr 3 , 77.Xr strchr 3 ,
69.Xr strcspn 3 , 78.Xr strcspn 3 ,
70.Xr strpbrk 3 , 79.Xr strpbrk 3 ,
@@ -75,6 +84,5 @@ returns the number of characters spanned.
75.Sh STANDARDS 84.Sh STANDARDS
76The 85The
77.Fn strspn 86.Fn strspn
78function 87function conforms to
79conforms to
80.St -ansiC . 88.St -ansiC .