converting input serial string to usable HEX or int value

Hi,

I have just started using Arduino and I am interfacing a controller with the the board.
I am getting serial data in fixed length format of 20 characters and I have to recover the analog value in between the string.
I have been able to store incoming data in a char array but it is printing ASCII values. FOr values from 0 to 9, I can convert it into equivalent decimal value by subtracting '0' character.
The issue is with character like A to F.
Can some help me how can I convert these values in corresponding HEX values?
Thanks

Can some help me how can I convert these values in corresponding HEX values?

'A' - 'A' is 0. Add 10, and you get 'A' = 10
'B' - 'A' is 1. Add 10, and you get 'B' = 11
and so on.

  char c = 'D';
  byte val = c - 'A' + 10;

val will be 14.

Have a look at the parse example in Serial Input Basics

...R