str_character_count_c
count.i4.v = str_character_count_c(string.i1a.r, length.i4.v,
character.i1.v)
This routine will return the number of occurrences of a specific
character in a string.
string string to search
length length of string to search (a value of zero
will result in a search up to a null terminator)
character character to find
This function returns status values as follows:
CBS_INVARG invalid length passed
otherwise number of occurrences of specified character
This function requires the following include files:
cnsparam_h, cbslib_h, acnet_errors_h
Related functions:
str_string_count_c, str_num_nonblank_c, str_find_character_c,
str_find_character_set_c, fndchr(_c), str_find_first_c,
str_find_string_c, str_find_last_string_c, str_replace_char_c,
str_replace_char_set_c, str_replace_string_c, str_remove_char_set_c,
fndfst, strstr, strstr_nocase, str_get_first_c,
str_find_not_in_character_set_c
C/C++ usage:
static const char string[] = "string";
char character = 'r';
int count;
int length = 0;
count = str_character_count_c(string,length,character);