The moose likes Java in General and the fly likes Hexadecimal to String and vis versa Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Hexadecimal to String and vis versa" Watch "Hexadecimal to String and vis versa" New topic
Author

Hexadecimal to String and vis versa

Ayman Nour
Greenhorn

Joined: Mar 27, 2003
Posts: 9
hi all,
Some data is stored in the database in hexadecimal format. how i can i convert it hexadecimal to normal string and vis versa??
please help.
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Integer.parseInt(hexString, 16)
Integer.valueOf(hexString, 16)
Integer.toString(number, 16)
Integer.toHexString(number)
There are Long versions of the same, should you wish.
- Peter
Ayman Nour
Greenhorn

Joined: Mar 27, 2003
Posts: 9
tank you peter.
I will try them.
how do i get a list of radix's?
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
The radix of binary numbers is 2, of octal numbers 8, of decimal numbers 10, and of hexadecimal numbers 16 -- but you can use any radix you want. I think it goes a bit pear-shaped beyond radix 36, though, because you run out of letters to represent your digits
- Peter
 
 
subject: Hexadecimal to String and vis versa
 
Threads others viewed
Incrementing alphanumeric string
please help ???? how to convert hexadecimal ,octol to decimal values and back
differences between AXIS and JWSDP
Ch7, selftest q14, and q16, clarifying my questions!!
How to use AES DECRYPT_MODE?
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture