.Length / .ToUpper()
Try it yourself →Length and case conversion.
Syntax
text.Length // text.ToUpper()
Description
Length gives the character count. ToUpper converts to uppercase, ToLower to lowercase (returns a new text, the original remains unchanged).
Example
using System; var s = "HexLibrary"; Console.WriteLine(s.Length); Console.WriteLine(s.ToUpper()); Console.WriteLine(s.ToLower());
Expected output
10 HEXLIBRARY hexlibrary
When to use?
Input validation, case-insensitive comparison.