How to convert ASCII to int?

前端 未结 8 1392
独厮守ぢ
独厮守ぢ 2021-01-17 10:08

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; 

This is an ASC

8条回答
  •  南方客
    南方客 (楼主)
    2021-01-17 10:48

    Use:

    try
    {      
      int i = Integer.parseInt(StringValue);
    }
    catch (NumberFormatException nfe)
    {
      System.out.println("NumberFormatException: " + nfe.getMessage());
    }
    

提交回复
热议问题