Get ascii code of a string

String str="A";

How do I get the ascii code of str?
LVL 9
william007Asked:
Who is Participating?
 
girionisCommented:
int ascii = str.charAt(0)
0
 
StillUnAwareCommented:
Charcter.codePointAt(str, 0);
0
 
StillUnAwareCommented:
typo:

Character.codePoint(str, 0); // where 0 is the index in the str string
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
Mayank SAssociate Director - Product EngineeringCommented:
What do you mean by ASCII code of the string? You can get ASCII code of individual characters as shown above.
0
 
sciuriwareCommented:
typo again:

     int i = Character.codePointAt(str, 0);

;JOOP!
0
 
william007Author Commented:
Thanks=)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.