如何将ASCII转换为int? [英] How to convert ASCII to int?

查看:114
本文介绍了如何将ASCII转换为int?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在获取ASCII值,并且想将其转换为整数,因为我知道它是整数ASCII值.

I am getting an ASCII value and I want to convert it into an integer because I know it's an Integer ASCII value.

int a=53; 

这是5的ASCII值.我如何将其转换为整数?

This is an ASCII value for 5. How would I be able to convert it to an integer?

推荐答案

int asciiValue = 53;
int numericValue = Character.getNumericValue(asciiValue);

System.out.println(numericValue);

这篇关于如何将ASCII转换为int?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆