Java - Change int to ascii

前端 未结 7 889
迷失自我
迷失自我 2020-12-01 07:32

Is there a way for java to convert int\'s to ascii symbols?

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-01 08:24

    If you first convert the int to a char, you will have your ascii code.

    For example:

        int iAsciiValue = 9; // Currently just the number 9, but we want Tab character
        // Put the tab character into a string
        String strAsciiTab = Character.toString((char) iAsciiValue);
    

提交回复
热议问题