[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How can I convert binary to hexadecimal?

Posted on 2008-11-13
3
Medium Priority
?
515 Views
Last Modified: 2013-12-29
Hi,
 
 I have a web service where I receive binary in a String (e.g. "100111001") and I need to convert it to hexadecimal and then to String to return it.  Are there any libraries that do this for me?

Thanks!
0
Comment
Question by:pbenito
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 22953133
Try

String hex = Integer.toString(Integer.parseInt("100111001", 2), 16);

Open in new window

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 22953609
:-)
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month18 days, 1 hour left to enroll

830 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