Solved

Get ascii code of a string

Posted on 2006-07-20
6
1,176 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

776 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