2012-04-07 93 views
5

你好有誰知道如何獲得字符數或字符串的值?我需要知道一個字符串有多大才能正確使用它。像:如何獲取字符串長度

string.getLength(); 
+2

http://docs.oracle.com/javase/6/docs/api/java/lang/String.html – L7ColWinters 2012-04-07 01:19:50

回答

19

你可以找到一個字符串的長度爲string.length()