public static void main(String[] args) throws UnsupportedEncodingException {
String s = "1/1/2/11300001\11310001/2300001\2310001";
System.out.println(s.length());
}明明长度为39 而打印结果为33.求教
本文详细探讨了Java中处理字符串时出现长度不匹配的问题,通过一个具体的实例展示了一个看似简单的字符串打印操作为何输出错误结果,并提供了正确的解决方案。
public static void main(String[] args) throws UnsupportedEncodingException {
String s = "1/1/2/11300001\11310001/2300001\2310001";
System.out.println(s.length());
}
500

被折叠的 条评论
为什么被折叠?
