LabWindows/CVI

Content Type
Programming Language
Current manual
Table of Contents

strspn

strspn

size_t strspn (const char stringToSearch[], const char characterSet[]);

Purpose

Locates the position of the first character in a string that is not in a specified set of characters. The return value corresponds to the length of the initial segment of a string that contains only characters from the specified set.

Parameters

Input
Name Type Description
stringToSearch const char [] Contains a pointer to the string that is searched for a character not in characterSet.
characterSet const char [] Contains a pointer to the character set containing the characters that are searched for in the specified string.

Return Value

Name Type Description
matchedCharIndex size_t Contains the index value of the string corresponding to the first character that does not match any in the specified character set. This value also corresponds to the length of the segment in the string that contains only characters from the character set. If all characters in the string are in the character set, the function returns the index of the terminating ASCII NUL byte.

Additional Information

Library: ANSI C Library

Include file: ansi_c.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Was this information helpful?

Previous

strcspn

Next

strstr

Previous

strcspn

Next

strstr