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