.length / .toUpperCase()
Try it yourself →Length and case conversion.
Syntax
text.length // text.toUpperCase()
Description
length gives the number of characters. toUpperCase converts to uppercase, toLowerCase converts to lowercase (returns new text, original remains unchanged).
Example
void main() {
var s = "HexLibrary";
print(s.length);
print(s.toUpperCase());
print(s.toLowerCase());
}Expected output
10 HEXLIBRARY hexlibrary
When to use?
Input validation, case-insensitive comparison.