Java - Change int to ascii

前端 未结 7 852
迷失自我
迷失自我 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);
    
    0 讨论(0)
提交回复
热议问题