Solved

Get ascii code of a string

Posted on 2006-07-20
6
1,169 Views
Last Modified: 2007-11-27
String str="A";

How do I get the ascii code of str?
0
Comment
Question by:william007
6 Comments
 
LVL 14

Expert Comment

by:StillUnAware
ID: 17144681
Charcter.codePointAt(str, 0);
0
 
LVL 35

Accepted Solution

by:
girionis earned 400 total points
ID: 17144682
int ascii = str.charAt(0)
0
 
LVL 14

Expert Comment

by:StillUnAware
ID: 17144683
typo:

Character.codePoint(str, 0); // where 0 is the index in the str string
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 30

Expert Comment

by:Mayank S
ID: 17144749
What do you mean by ASCII code of the string? You can get ASCII code of individual characters as shown above.
0
 
LVL 24

Assisted Solution

by:sciuriware
sciuriware earned 100 total points
ID: 17144751
typo again:

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

;JOOP!
0
 
LVL 9

Author Comment

by:william007
ID: 17264943
Thanks=)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
network + 7 80
@SBGen Method 3 38
servlet requestdispatcher include and forward differences 1 25
expectj telnet failing 5 26
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now