C# Char IsAsciiHexDigitLower() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Char

Definition

In C#, Char.IsAsciiHexDigitLower returns true for 0–9 and lowercase a–f only.

Uppercase A–F return false. These ASCII helpers are available in .NET 7 and later. On older runtimes, use range checks such as c >= '0' && c <= '9'.

This is a static member of System.Char. You call it with the type name, such as Char.IsAsciiHexDigitLower(...) or char.IsAsciiHexDigitLower(...). A char holds one 16-bit UTF-16 code unit.

Syntax

Use when hex text must be lowercase.

C#
bool ok = Char.IsAsciiHexDigitLower('a');
CallWhat it does
Char.IsAsciiHexDigitLower(c)True for 0–9 and a–f.

Digits are allowed; only the letter case is restricted.

Library declarations
C#
public static bool IsAsciiHexDigitLower(char c);

Parameters

ParameterDescription
cCharacter to test.

Return Value

Return ValueDescription
trueLower hex digit.
falseNot lowercase hex.

C# Examples

Example 1 — a Passes, A Fails

Compare a and A.

C#
using System;

class Program {
    static void Main() {
        Console.WriteLine(Char.IsAsciiHexDigitLower('a'));
        Console.WriteLine(Char.IsAsciiHexDigitLower('A'));
    }
}

How It Works

  1. Lower a. Accepted.
  2. Upper A. Rejected by this helper.
  3. Style lock. Forces lowercase hex letters.
  4. .NET 7+. Newer API.

Example 2 — Digits Still Count

Show that 7 passes.

C#
using System;

class Program {
    static void Main() {
        Console.WriteLine(Char.IsAsciiHexDigitLower('7'));
        Console.WriteLine(Char.IsAsciiHexDigitLower('f'));
    }
}

How It Works

  1. Digit seven. Digits are lowercase-hex-safe.
  2. Letter f. End of a–f range.
  3. Both true. Expected hex alphabet for lower style.
  4. No uppercase. F would fail.

Example 3 — Reject Upper Hex

Validate ff but not FF.

C#
using System;

class Program {
    static void Main() {
        string lower = "ff";
        string upper = "FF";
        bool a = Char.IsAsciiHexDigitLower(lower[0]) && Char.IsAsciiHexDigitLower(lower[1]);
        bool b = Char.IsAsciiHexDigitLower(upper[0]) && Char.IsAsciiHexDigitLower(upper[1]);
        Console.WriteLine("ff: " + a);
        Console.WriteLine("FF: " + b);
    }
}

How It Works

  1. Lower pair. ff validates.
  2. Upper pair. FF fails the lower-only rule.
  3. Two flags. Print both outcomes.
  4. Format rules. Useful when APIs demand lowercase hex.

Frequently Asked Questions

Yes, 0–9.
No—use IsAsciiHexDigit or the Upper helper.
.NET 7+.
IsAsciiHexDigit and IsAsciiHexDigitUpper.
Yes.

Next: IsAsciiHexDigitUpper()

Return true for ASCII hex digits 0–9 and A–F (uppercase). .NET 7+ with System.Char.

IsAsciiHexDigitUpper() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

9 people found this page helpful