字串屬性 length



返回字串長度,包括空格、製表符和換行符。

語法

String.length

示例

void main() { 
   String str = "Hello All"; 
   print("The length of the string is: ${str.length}"); 
} 

將會產生以下輸出 -。

The length of the string is: 9
dart_programming_string.htm
廣告
© . All rights reserved.