Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <string.h>
    size_t strcspn( const char *str,
                    const char *charset );
    size_t _fstrcspn( const char __far *str,
                      const char __far *charset );
    #include <wchar.h>
    size_t wcscspn( const wchar_t *str,
                    const wchar_t *charset );
    #include <mbstring.h>
    size_t _mbscpsn( const unsigned char *str,
                     const unsigned char *charset );
    size_t _fmbscpsn( const unsigned char __far *str,
                      const unsigned char __far *charset );

Description:
    The strcspn function computes the length, in bytes, of the initial
    segment of the string pointed to by str which consists entirely of
    characters not from the string pointed to by charset.  The terminating
    null character is not considered part of str.

    The _fstrcspn function is a data model independent form of the strcspn
    function that accepts far pointer arguments.  It is most useful in mixed
    memory model applications.

    The wcscspn function is a wide-character version of strcspn that
    operates with wide-character strings.

    The _mbscspn function is a multibyte character version of strcspn that
    operates with multibyte character strings.

Returns:
    The length, in bytes, of the initial segment is returned.

Example:
    #include <stdio.h>
    #include <string.h>

    void main()
      {
        printf( "%d\n", strcspn( "abcbcadef", "cba" ) );
        printf( "%d\n", strcspn( "xxxbcadef", "cba" ) );
        printf( "%d\n", strcspn( "123456789", "cba" ) );
      }

    produces the following:

    0
    3
    9

Classification:
    strcspn is ANSI, _fstrcspn is not ANSI, wcscspn is ANSI, _mbscspn is not
    ANSI, _fmbscspn is not ANSI

Systems:
     strcspn - All, Netware

    _fstrcspn - All
    wcscspn - All
    _mbscspn - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32
    _fmbscspn - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32

See Also:
    strspn

See Also:

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