当前位置: 首页 > 文档资料 > Dart 中文教程 >

Length

优质
小牛编辑
122浏览
2023-12-01

返回字符串的长度,包括空格,制表符和换行符。

语法 (Syntax)

String.length

例子 (Example)

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

它将产生以下output - 。

The length of the string is: 9