SyntaxFix
Write A Post
Hire A Developer
Questions
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.