转成ASCII~~~再转成字符可行吧- package com.itheima;
- public class TestDeom {
- public static void main(String[] args) throws Exception {
- String info = "1101000 1100101 1101100 1101100 1101111 100000 1110111 1101111 1110010 1101100 1100100";
- String[] strArray = info.split("\\s");
- byte[] byteArray = new byte[strArray.length];
- for(int i = 0; i < strArray.length; i ++)
- byteArray[i] = (byte) Integer.parseInt(strArray[i], 2);
- System.out.println(new String(byteArray, "ascii"));
- }
- }
复制代码 |