i have to convert a string into ascii format and then into it's binary.
I know how to convert between int to binary using toBinaryString, so how to convert ascii to int.
Or is there any other way to convert string characters into binary form.
In short suppose there is a string like "how are you" , so i have to convert it into binary form.
hszforu
-3
Junior Poster in Training
Recommended Answers
Jump to PostI don't know whether this is an good way of coding but i tried converting String to binary and i don't think Java uses ASCII it uses UNICODE CODE POINT.
Anyways what you can do is first convert your String to byte array by using the getBytes() method and then …
Jump to PostAre you asking something like how to convert this String: "A" to this: "1000001"
All 7 Replies
Rameshwar Soni
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
hszforu
-3
Junior Poster in Training
NormR1
563
Posting Sage
Team Colleague
hszforu
-3
Junior Poster in Training
Ezzaral
commented:
That is exactly what NormR1 just posted.
-3
NormR1
563
Posting Sage
Team Colleague
hszforu
-3
Junior Poster in Training
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.