Java ASCII from toAscii(String hexStr)

Here you can find the source of toAscii(String hexStr)

Description

to Ascii

License

Open Source License

Declaration

public static String toAscii(String hexStr) 

Method Source Code

//package com.java2s;
/*/*from w  w w .  j  a v a2  s .c  o m*/
 * Author   : Ardika Rommy Sanjaya
 * Website   : http://ardikars.com
 * Contact   : contact@ardikars.com
 * License   : Lesser GNU Public License Version 3
 */

public class Main {
    public static String toAscii(String hexStr) {
        StringBuilder sb = new StringBuilder("");
        for (int i = 0; i < hexStr.length(); i += 2) {
            String str = hexStr.substring(i, i + 2);
            sb.append((char) Integer.parseInt(str, 16));
        }
        return sb.toString();
    }
}

Related

  1. toAscii(byte[] ba)
  2. toAscii(char ch)
  3. toAscii(char source)
  4. toAscii(int i, boolean reversed)
  5. toAscii(int number)
  6. toAscii(String notAscii)
  7. toAscii(String s)
  8. toAscii(String s)
  9. toASCII(String s)