Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Returns the ASCII value as an integer in Java

I'm trying to get the Ascii value of character but I'm a bit clueless

So far I've found

 Character.getNumericValue

But when I read the documentation it says

Returns the int value that the specified Unicode character

In php I used to use ord(string String)

So will Character.getNumericValue do for me?

like image 328
Lamis Avatar asked Feb 20 '23 06:02

Lamis


1 Answers

All you have to do is cast (int) c, where c is your char (i.e. character).

like image 140
user1329572 Avatar answered Feb 27 '23 08:02

user1329572