请问如何把一个字节数组(内容为ASCII字符)转换为一个字符串? C#中有如下方法,java中呢?byte[] x = new byte[4]{49,50,51,52};String str = System.Text.Encoding.ASCII.GetString(x);//现在str = “1234”; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 byte[] x = new byte[]{49,50,51,52}; System.out.println(new String(x)); byte[] x = new byte[]{49,50,51,52};String str = new String(x); package testString;public class ASCToString { public static String ascToString(byte[] cs){ String s; return s = new String(cs); }}建了个静态方法,方便使用~~~~ 循环一定可以改成递归吗? 大哥们帮帮怎么文本框不显示 数组边界溢出问题?? JAVA 小程序 请问,不规则窗体怎么实现 能解释一下什么是套接字? 如何取时钟时间? Oracle查询出现异常 关于静态方法的OVERRIDE。 jframe和frame的repaint方法的不同 高手请帮看个错误源的问题....(通常是怎么引起的...刚刚学会给分) JLIST为什么屏蔽它的JScrollPane, 不让它滚动
System.out.println(new String(x));
String str = new String(x);
public static String ascToString(byte[] cs){
String s;
return s = new String(cs);
}}建了个静态方法,方便使用~~~~