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');
Call
What 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
Parameter
Description
c
Character to test.
Return Value
Return Value
Description
true
Lower hex digit.
false
Not 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'));
}
}
Output
True
False
How It Works
Lower a. Accepted.
Upper A. Rejected by this helper.
Style lock. Forces lowercase hex letters.
.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'));
}
}
Output
True
True
How It Works
Digit seven. Digits are lowercase-hex-safe.
Letter f. End of a–f range.
Both true. Expected hex alphabet for lower style.
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);
}
}
Output
ff: True
FF: False
How It Works
Lower pair. ff validates.
Upper pair. FF fails the lower-only rule.
Two flags. Print both outcomes.
Format rules. Useful when APIs demand lowercase hex.