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 strspn( const char *str,
                   const char *charset );
    size_t _fstrspn( const char __far *str,
                     const char __far *charset );
    #include <wchar.h>
    size_t wcsspn( const wchar_t *str,
                   const wchar_t *charset );
    #include <wchar.h>
    size_t _mbsspn( const unsigned char *str,
                    const unsigned char *charset );
    size_t _fmbsspn( const unsigned char __far *str,
                     const unsigned char __far *charset );

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

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

    The wcsspn function is a wide-character version of strspn that operates
    with wide-character strings.

    The _mbsspn function is a multibyte character version of strspn that
    operates with multibyte character strings.

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

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

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

    void main()
      {
        printf( "%d\n", strspn( "out to lunch", "aeiou" ) );
        printf( "%d\n", strspn( "out to lunch", "xyz" ) );
      }

    produces the following:

    2
    0

Classification:
    strspn is ANSI, _fstrspn is not ANSI, wcsspn is ANSI, _mbsspn is not
    ANSI, _fmbsspn is not ANSI

Systems:
     strspn - All, Netware

    _fstrspn - All
    wcsspn - All
    _mbsspn - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32
    _fmbsspn - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32

See Also:
    strcspn, strspnp

See Also:

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