字符串属性 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
返回字符串的长度,包括空格、制表符和换行符。
String.length
void main() {
String str = "Hello All";
print("The length of the string is: ${str.length}");
}
它将产生以下输出 −.
The length of the string is: 9
