Goto main content

strcspn

Find length of initial segment not matching mask.

STRCSPN

NAME

strcspn - Finds length of the initial segment not containing any of the characters that are part of the mask.

SYNOPSIS

strcspn(string,mask,start,length)

PARAMETERS

string
The input string.
mask
The mask characters.
start
The starting position of the string to examine.
length
The length of the string to examine.

RETURN

Returns the length of the segment as an integer.

EXAMPLES

in:  res=<{strcspn('abcd',  'apple', -3)}>.
out: res=3.

in:  res=<{strcspn('abcd',  'apple')}>.
out: res=0.

in:  res=<{strcspn('hello', 'world')}>.
out: res=2.

SEE ALSO

{{ include("includes/strings.sn") }}

AUTHOR

Written by Pusnei Sergey and Caroline Laplante, <sergey@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.