【发布时间】:2011-09-06 10:36:08
【问题描述】:
我用下面的代码来找到长度
String str=strLenData.toString();
int ipLen= str.length();
return ipLen;
ipLen 每次都会返回 11。无论strLenData 的实际值是多少。当我调用 toString() 函数时,str 的值:“[C@40523f80”。现在我必须使用 char[] 并且我需要知道 char[] 的结尾(或长度)。
我该怎么做?
【问题讨论】:
-
你能展示构造strLenData的代码吗?