.count / .uppercased()
Length and case conversion.
Syntax
text.count // text.uppercased()
Description
count gives the number of characters (not length!). uppercased converts to uppercase, lowercased to lowercase (returns new text).
Example
Loading editor…
Expected output
10 HEXLIBRARY hexlibrary
When to use?
Input validation, case-insensitive comparison.
Common mistakes
- ⚠️ Length is determined by .count, not .length.