Relay shield example help

Hi,

I’m new to particle and trying to figure out some of the code. In the relay shield example:
https://docs.particle.io/datasheets/particle-shields/#relay-shield-sample-code

there is a line of code:
int relayNumber = command.charAt(1) - ‘0’;

I understand everything except why
='0’
is at the end of the line.
Can anyone shed light on this?

Thanks,
Rich

command.charAt(1) returns a character, which will be 1, 2, 3, etc. as an ASCII character code, which has a numerical value of 49, 50 and 51, respectively. What’s that’s doing is subtracting the value of the ASCII character code for zero (a numerical value of 48), to get a numerical value of 1, 2, 3, etc. corresponding to a relay number.

Thanks!