C
char * strnchr( const char * searchString, size_t count, char c );
Description
Searches a string up to a specified number of characters for a specific character. The string is searched forward and the first occurance location is returned. If the search character is not present in the string, or if the maximum character count is reached first, then a NULL pointer is returned.
Preconditions
None
Parameters
Parameters |
Description |
searchString |
Pointer to a null terminated string to search. If count is less than the string size, then the string need not be null terminated. |
count |
Maximum number of characters to search before aborting. |
c |
Character to search for |
Returns
Pointer to the first occurance of the character c in the string searchString. If the character is not found or the maximum count is reached, a NULL pointer is returned.