C# System.Char – 2 Questions per Function (Moderate–High)

Use these questions for associate assessments and interview practice.

IsDigit

  1. Count numeric characters in a string containing spaces and digits.
  2. From "AB12C03Z9", extract digits and convert to an integer array.

IsLetter

  1. Validate that a password contains at least 5 alphabetic characters.
  2. Remove everything except letters and spaces.

IsLetterOrDigit

  1. Strip all special characters but keep letters and digits.
  2. Validate username: alphanumeric only, length ≥ 8.

IsUpper

  1. Count uppercase letters in a paragraph.
  2. Detect if more than 60% characters are uppercase.

IsLower

  1. Count lowercase letters.
  2. Convert only lowercase letters to uppercase.

IsWhiteSpace

  1. Count spaces, tabs, and newlines.
  2. Replace multiple whitespaces with one.

IsSymbol

  1. Extract mathematical symbols.
  2. Ensure product code contains at least one symbol.

IsPunctuation

  1. Remove punctuation from text.
  2. Count punctuation marks.

IsControl

  1. Detect invisible control characters.
  2. Clean ASCII control characters from logs.

IsNumber

  1. Detect Unicode numeric characters.
  2. Count numerics including Roman numerals.

IsSeparator

  1. Identify Unicode separators.
  2. Split string using separator chars.

IsSurrogate

  1. Detect emoji surrogate pairs.
  2. Validate UTF-16 surrogate correctness.

IsHighSurrogate

  1. Find indices of high surrogates.
  2. Verify surrogate ordering.

IsLowSurrogate

  1. Ensure every low surrogate has high surrogate.
  2. Repair broken UTF-16 text.

ToUpper

  1. Convert only vowels to uppercase.
  2. Capitalize first letter of each word.

ToLower

  1. Convert only consonants to lowercase.
  2. Normalize input ignoring case.

ToUpperInvariant

  1. Culture-independent case conversion.
  2. Compare product codes ignoring culture.

ToLowerInvariant

  1. Normalize database identifiers.
  2. Case-insensitive dictionary lookup.

GetUnicodeCategory

  1. Count by Unicode category.
  2. Detect emoji vs punctuation vs letters.

Parse

  1. Convert char '9' to integer.
  2. Validate single-character menu input.

TryParse

  1. Accept only valid char commands.
  2. Validate keyboard input.

Equals

  1. Compare two chars ignoring case.
  2. Detect duplicate consecutive chars.

CompareTo

  1. Manual character sorting.
  2. Lexicographical order check.

ToString

  1. Comma-separated characters.
  2. Build output using char-to-string only.

MinValue

  1. Validate char range boundaries.
  2. Detect invalid binary char values.

MaxValue

  1. Check Unicode boundary cases.
  2. Validate char serialization.