如果只有数字的话,for循环加上个swich case就可以了。

解决方案 »

  1.   

    String classpublic String substring(int beginIndex,
                            int endIndex)Byte class
    public static byte parseByte(String s)
                          throws NumberFormatException
      

  2.   

    我试着写了一个,方法挺笨的,请各位大侠指教
    public class MyCast
    { public static void main(String[] args)
    {
    String No=new String("13843074582");   byte[] tt=new byte[12];   for(int i=0;i<tt.length;i++)
      {tt[i]=0x30;}   byte t[]=No.getBytes();
      for(int i=0;i<t.length;i++)
      {
      tt[i]+=t[i]-48;
                         //用十六进制显示出来
                         System.out.println("0x"+ tt[i]/16+tt[i]%16);
    }
    }
    }