|STRSPN(3)||Library Functions Manual||STRSPN(3)|
char *s, const char
strspn() function spans the initial part of the NUL-terminated string s as long as the characters from s occur in string charset.
strspn() function returns the number of characters spanned.
strspn() will return 3, since the first three characters of string s are part of string charset:
char *s = "foobar"; char *charset = "of"; size_t span; span = strspn(s, charset);
strspn() function conforms to ANSI X3.159-1989 (“ANSI C89”).
strspn() function first appeared in AT&T System III UNIX and was reimplemented for 4.3BSD-Tahoe.
|June 5, 2013||OpenBSD-current|