Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>strspn</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
strspn

Usage

   #include <string.h>
   size_t strspn(const char *string1,const char *string2);

   ANSI

Description

   Returns the length of the initial segment of string1 which consists
   entirely of characters found in string2.

Example

   #include <string.h>
   #include <stdio.h>
   #include <stdlib.h>

   char *string = "Example";
   char *cmp = "aEx";

   int main()
   {
       int result;
       printf("Length of string in [%s] ",string);
       printf("containing [%s] characters\n",cmp);

       printf("strspn is [%d]\n",strspn(string,cmp));
       return EXIT_SUCCESS;
   }





Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson