Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get ascii code of a string

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

How do I get the ascii code of str?
0
Comment
Question by:william007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 14

Expert Comment

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

Accepted Solution

by:
girionis earned 1600 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
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 400 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

721 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