Simple Code Questions

I was looking at the code example for the relay shield. I dont undertand this line:
// parse the relay number
int relayNumber = command.charAt(1) - ‘0’;

Specifically, why if you are just parsing for the number at position 1 in the string, do you need to subtract ‘0’?

That’s because the String is a sequence of ASCII characters and the representation of numbers is decimal values 48 (‘0’) to 57 ("9’). What is being subtracted is the ASCII character ‘0’ not the number 0. So you end up with integers ranging from 0 to 9

For a more detailed explanation look in this thread