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

x
?
Solved

How to convert 8 bit binary string to decimal or integer or ASCII code

Posted on 2002-03-21
1
Medium Priority
?
1,063 Views
Last Modified: 2012-08-14
How to convert 8 bit binary string to ASCII code.
what i want something like this

01010011 01100101 01100011 01110010 01100101 01110100 00100001

convert it of this to ascii code
0
Comment
Question by:dxding
[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
1 Comment
 
LVL 9

Accepted Solution

by:
Venci75 earned 1200 total points
ID: 6885922
try this:
String src = "01010011 01100101 01100011 01110010 01100101 01110100 00100001";
java.util.StringTokenizer tok = new java.util.StringTokenizer(src, " ");
StringBuffer res = new StringBuffer();
while (tok.hasMoreTokens()) {
    char c = (char) Integer.parseInt(tok.nextToken(), 2);
    res.append(c);
}
System.out.println(res.toString());
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

670 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