I have to convert a normal string array with the value {“STX”,”ETX”} into hex value and I should get {2,3} according to http://www.asciitable.com/.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It sounds like you want a
Map<String, Char>such as:I don’t believe there’s any such map built into the Java standard libraries.
Converting the
Charinto a hex string is then a separate step. There are lots of options there, partly depending on which version of Java you’re using.