Results 1 to 2 of 2
  1. #1
    ali_sakar is offline Member
    Join Date
    Feb 2009
    Posts
    29
    Rep Power
    0

    Cool Getting ascii from a String

    Hi,

    Below are lines of codes how I get the data from serial port.


    byte[] readBuffer = new byte[1];
    int numBytes = inputStream.read(readBuffer);
    String result = new String(readBuffer);

    This data which I get from serial port is a Delivery Report from GSM modem. I read it 1 character at a time. These characters also contains junk characters like '>', 'Enter Key',etc.. I want to make it more understandable by only putting text characters in a text file. Now for this I want to check the ascii values of these characters.

    Can anyone help in How to get the ascii values from a String variable.


    Regards
    Ali.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default

    Read the API for String.replaceAll and java.util.regex.Pattern

    db

Similar Threads

  1. Another ascii question....
    By akira220984 in forum New To Java
    Replies: 5
    Last Post: 02-20-2009, 02:38 AM
  2. Converting ASCII format
    By right2001 in forum New To Java
    Replies: 7
    Last Post: 02-17-2009, 04:55 PM
  3. I need help with ascii characters
    By Grandon in forum Eclipse
    Replies: 17
    Last Post: 11-08-2008, 03:12 AM
  4. Ascii code.........
    By Somitesh Chakraborty in forum New To Java
    Replies: 6
    Last Post: 11-04-2008, 06:32 PM

Posting Permissions

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