Find the repeat appearance times of the prefix character at the beginning of a string.
int find_prefix_char_number( const string & str, char ch )
the repeat appearance times of the prefix char at the beginning of of a string.
EX1
void find_prefix_char_number_ex1() { string str = "pppabcde"; char pch = 'p'; //Change 'p' to other char to see different result int nRet = find_prefix_char_number(str, pch); if(nRet) printf("Prefix char \'%c\' repeat %d times in \"%s\" \n" ,pch,nRet,str); else printf("\'%c\' is not the prefix char in \"%s\"\n" ,pch,str); }
find_end_char_number
origin.h