I just want to know if there\'s a better solution to parse a number from a character in a string (assuming that we know that the character at index n is a number).
Try the following:
str1="2345"; int x=str1.charAt(2)-'0'; //here x=4;
if u subtract by char '0', the ASCII value needs not to be known.