String的length()方法public int length() Returns the length of this string. The length is equal to the number of 16-bit Unicode characters in the string. http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html想要知道某个类的方法,可以查看java的相关文档,如果你的开发环境是Jbuilder,可以查看帮助 甚至,在Google中输入"String java",通常第一个就是sun的相关文档不过我也是菜鸟
看java api帮助
字符串的长度:String s = "James Fancy";
int len = s.length();
这里有在线的 1.5.0 的文档http://java.sun.com/j2se/1.5.0/download.jsp
这里有文档的下载,文档下载后打开,从首页进去找 API如果是 1.4 的,路径相应改动就行。
Returns the length of this string. The length is equal to the number of 16-bit Unicode characters in the string. http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html想要知道某个类的方法,可以查看java的相关文档,如果你的开发环境是Jbuilder,可以查看帮助
甚至,在Google中输入"String java",通常第一个就是sun的相关文档不过我也是菜鸟