Get ascii code of a string

Posted on 2006-07-20
Last Modified: 2007-11-27
String str="A";

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

Expert Comment

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

Accepted Solution

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

Expert Comment

ID: 17144683

Character.codePoint(str, 0); // where 0 is the index in the str string
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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.
LVL 24

Assisted Solution

sciuriware earned 100 total points
ID: 17144751
typo again:

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


Author Comment

ID: 17264943

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Android studio getdrawable(int) is deprecated 4 114
varialbe initialization 11 37
expectj telnet failing 5 45
Cisco ASA: Java web start no go, asdm launcher no go 3 34
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)
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

809 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