Find the first character in one string that is not in another.
Compatibility:This function is compatible with the following targets:
|
|
#include <string.h>
size_t strspn(const char *s1, const char *s2);Parameters:
Parameters for this facility are:
Both s1 and s2 must point to null terminated character arrays.
strspn() returns the index of the first character in s1 that does not match a character in s2.
#include <string.h>
#include <stdio.h>
int main(void)
{
static char s1[] = "create *build* construct";
static char s2[] = "create *";
printf(" s1 = %s\n s2 = %s\n", s1, s2);
printf(" %d\n", strspn(s1, s2));
return 0;
}
Output:
s1 = create *build* construct
s2 = create *
8
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000