Next: , Previous: str_rep, Up: Strings


4.5 str_tokcnt

count the number of tokens in a string.

Synopsis

     #include <suplib/str.h>
     
     
     
size_t str_tokcnt( const char *string, const char *delim );

Parameters

const char *string
string to parse
const char *delim
the delimiters to use

Description

str_tokcnt determines the number of tokens which would be returned in the course of calling the strtok function through completion. It does not change the passed string.

Returns

it returns the number of tokens in the string.

Author

Diab Jerius