I need some help in Identifying the string. I have incoming string like this *H1999999#
it can vary from *H1000000#~*H1999999#
sometimes it is *H1FINE#
or *H1MED#
or any other text in between.Now what I have already done is I have parsed the numeric string and copied the integer value to a buffer. Here is the code for that.
char H1subbuff[10];
char *ptr;
if ((strncmp(rec,"*H1", 3) == 0) && (rec[9] == '#'))
{
memcpy(H1subbuff, &rec[3], 6 );
H1subbuff[6] = '\0';
H1Val = strtol(H1subbuff, &ptr, 10);
//Display H1VAL
}
Now my query is how can check if the String consist of Number or Alphabet. How can I check H1subbuff
data, so that I can compare. I need to do the same above process of parsing *H1FINE#
string.
Note :- The above two string doesn't have same string length.