STRSPN - scan string for span of characters.

(ANSI Standard)

Usage:

#include <string.h>
i = strspn( s, set );

Where:

const char *s;
points to the string to be scanned.
const char *set;
points to a string containing the set of characters to scan for.
size_t i;
is the number of characters at the beginning of "s" which also appear in the string "set".

Description:

"strspn" returns the number of characters from the string "set" that appear at the beginning of the string pointed to by "s". For example,

j = strspn(s," ");

determines how many leading blanks are at the start of "s".

Copyright © 1996, Thinkage Ltd.