Answers for "char to digit"

1

convert char to single digit

char c = '1';
int i = c - '0'; // i is now equal to 1, not '1'
Posted by: Guest on May-28-2021
2

char to int

int n = Character.getNumericValue(char);
Posted by: Guest on December-07-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language