How to get a character by its code?
There is an ASCII table. I have a value from the Oct column. How to get a symbol for exactly this value? I tried the options but it was on Dec
How to get a character by its code?
There is an ASCII table. I have a value from the Oct column. How to get a symbol for exactly this value? I tried the options but it was on Dec
Oct is an octal number system (Octal). Use
int dec = Integer.parseInt(oct, 8); to convert to the 10th number (this will be a Dec - Decimal column), and then use
char c = (char) dec; to get an ASCII character.
Full example:
String oct = "053"; int dec = Integer.parseInt(oct, 8); System.out.println("В десятичной с.с. будет " + dec); System.out.println("Знак ASCII будет " + (char) dec); As a result, we get in the answer + .
Source: https://ru.stackoverflow.com/questions/566271/
All Articles
Octas a string? - D-side