Dart String属性长度

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

语法

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.toLowerCase() 返回值类型返回一个字符串。 范例void mai ...