Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    I have checked the String library but cannot find anything.

    I need to convert a string, say "abc" to each of their ascii equivelant.

    Any clue how?

  2.  

  3. #2
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,945
    Member #
    2096
    Code:
    String test = "ABCD";
         for ( int i = 0; i < test.length(); ++i ) {
           char c = test.charAt( i );
           int j = (int) c;
           System.out.println(j);
           }
    found it here:
    http://www.rgagnon.com/javadetails/java-0004.html
    S. Rosland

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    6 times
    If this is for any real project, don't use ASCII. Java hearts Unicode and you should too. Unicode needs more bits to store a character than ASCII.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

converting string to ascii in java

,

get ascii code of string in java

,

how to convert a string to its ascii value in java

,

how to convert string into ascii values in java

,

java convert string to ascii

,
java get ascii code for string
,

java program to convert string to ascii character

,

java string to ascii

,

string ascii java

,

string to ascii java

Click on a term to search for related topics.
All times are GMT -6. The time now is 06:16 PM.
Powered by vBulletin® Version 4.2.0
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com