length property

int get length

Returns the length of the String after trimming leading and trailing whitespace.

Example:

String? text = " Hello ";
print(text.length); // 5
String? emptyText = "";
print(emptyText.length); // 0

Implementation

int get length => validate().length;