Borland C++ reference

strcspn, _fstrcspn

raw OCR

Scans a string for the initial segment not containing any subset of a given set of characters.

Defined in header <string.h>

Syntax

#include <string.h>
Near version: size_t strcspn(const char *sl, const char *s2);
Far version: sizet far far _fstrcspn(const char far *sl, const char far*s2)

Portability

DOSUNIXWindowsANSI CC++ only
Near version ■■■■
■■

Return value

strcspn returns the length of the initial segment of string si that consists entirely of characters not from string s2.

See also

Example

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

int main(void)
{
   char *stringl = "1234567890", *string2 = "747DC8";
   int length;
   length = strcspn(stringl, string2);
   printf("Character where strings intersect is at position %d\n", length);
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.