Check if a string begins with a particular string
bool is_str_match_begin( LPCSTR lpcszStart, LPCSTR lpcsz )
TRUE is lpcsz starts with lpcszStart, otherwize FALSE.
EX1
void is_str_match_begin_ex1() { string str = "origin lab"; string substr = "origin"; //Change to "Origin" or "opq" to see different results bool bRet = is_str_match_begin(substr , str); if(bRet) printf("\"%s\" begins with \"%s\" \n",str,substr); else printf("Match failed"); }
For the function 's input parameters ,lower case char in lpcszStart will match upper case char in lpcsz,however upper case char in lpcszStart will not match lower case char in lpcsz.So callers should make lpcszStart as lower case char sets to make function fully case insensitive.
is_str_match_begin_of_word
origin.h