Does anyone know some algorithms for converting to bases such as octal, hexadecimal,and binary?
Transcendent
-5
Junior Poster in Training
Recommended Answers
Jump to PostThe Integer class has methods for converting ints to Strings in binary, octal, hex, or any arbitrary base. Ditto for converting any of those formats back to int. Check out the API docs for details.
Jump to PostAre you talking about Strings in those formats? Like "111" as binary would have an int value of 7
I don't think there is a method to convert a String in one format to a String in another format. You will probably have to combine some methods to do that.
All 8 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Transcendent
-5
Junior Poster in Training
NormR1
563
Posting Sage
Team Colleague
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
TrustyTony
888
pyMod
Team Colleague
Featured Poster
Transcendent
-5
Junior Poster in Training
NormR1
563
Posting Sage
Team Colleague
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.