This works fine:
int foo = bar.charAt(1) - \'0\';
Yet this doesn\'t - because bar.charAt(x) returns a char:
int foo = bar.c
I will echo what @Mark Peters has said above in case people overlook his comment.
As I quote: " Don't make the mistake of thinking that '0' == 0. In reality, '0' == 48 "