How can I convert binary to hexadecimal?

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!
pbenitoAsked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
Try

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

Open in new window

0
 
CEHJCommented:
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.