nchar() / toupper()
Length and case conversion.
Syntax
nchar(s) toupper(s) tolower(s)
Description
nchar gives the character count (length() is the vector length!). toupper/tolower convert cases.
Example
Loading editor…
Expected output
10 HEXLIBRARY hexlibrary
When to use?
Input validation, text normalization.
Common mistakes
- ⚠️ Text length is with nchar(), not length().