Solved

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

Posted on 2002-03-21
1
1,040 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
1 Comment
 
LVL 9

Accepted Solution

by:
Venci75 earned 300 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
noX challenge 17 76
topping3 challenge 14 49
Impossible to extract MSI from new JAVA releases 2 38
maven example error 3 35
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now