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>strcspn</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
strcspn

Usage

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

   ANSI

Description

   strcspn searches string1 for the first occurrence of a character in
   string2.

Example 

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

   char string1[50] = " 1 Example string ";

   int main()
   {
       printf("\nstrcspn example [%d]\n",
               strcspn(string1,"s"));
       return EXIT_SUCCESS;
   }

Return Value

   It returns the length of the initial segment of string1 that consists of
   characters in string2 not found. If no character appears in string2, then
   the total length of string1 not counting the null  \0  terminator is
   returned.





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