5 /* strcspn( const char *, const char * )
7 This file is part of the Public Domain C Library (PDCLib).
8 Permission is granted to use, modify, and / or redistribute at will.
15 size_t strcspn( const char * s1, const char * s2 )
24 if ( s1[len] == *p++ )
37 #include <_PDCLIB_test.h>
42 TESTCASE( strcspn( abcde, "x" ) == 5 );
43 TESTCASE( strcspn( abcde, "xyz" ) == 5 );
44 TESTCASE( strcspn( abcde, "zyx" ) == 5 );
45 TESTCASE( strcspn( abcdx, "x" ) == 4 );
46 TESTCASE( strcspn( abcdx, "xyz" ) == 4 );
47 TESTCASE( strcspn( abcdx, "zyx" ) == 4 );
48 TESTCASE( strcspn( abcde, "a" ) == 0 );
49 TESTCASE( strcspn( abcde, "abc" ) == 0 );
50 TESTCASE( strcspn( abcde, "cba" ) == 0 );