In C#, Char.IsLowSurrogate returns true for low-surrogate code units (roughly U+DC00–U+DFFF).
A low surrogate should follow a high surrogate. Alone it is incomplete.
This is a static member of System.Char. You call it with the type name, such as Char.IsLowSurrogate(...) or char.IsLowSurrogate(...). A char holds one 16-bit UTF-16 code unit.
Syntax
Pass one code unit to test.
C#
bool ok = Char.IsLowSurrogate(c);
Call
What it does
Char.IsLowSurrogate(c)
True if c is a low surrogate.
Char.IsLowSurrogate(s, i)
Tests s[i].
Use after confirming a high surrogate at the previous index.
Library declarations
C#
public static bool IsLowSurrogate(char c);
public static bool IsLowSurrogate(string s, int index);
Parameters
Parameter
Description
c
Code unit to test.
s, index
Optional string index overload.
Return Value
Return Value
Description
true
Low surrogate.
false
Not a low surrogate.
C# Examples
Example 1 — Second Unit of Emoji
Identify the low surrogate.
C#
using System;
class Program {
static void Main() {
string emoji = "\U0001F600";
Console.WriteLine(Char.IsLowSurrogate(emoji[1]));
Console.WriteLine(Char.IsHighSurrogate(emoji[1]));
}
}
Output
True
False
How It Works
Index 1. Second code unit.
Low true. Matches IsLowSurrogate.
Not high. The second unit is not a high surrogate.
Pair anatomy. High then low.
Example 2 — Digit Is Not Low
Show that '5' is not a low surrogate.
C#
using System;
class Program {
static void Main() {
Console.WriteLine(Char.IsLowSurrogate('5'));
Console.WriteLine(Char.IsSurrogate('5'));
}
}
Output
False
False
How It Works
Digit five. Ordinary BMP char.
Not low. IsLowSurrogate false.
Not surrogate. Broader check false too.
Contrast. Surrogates appear mainly with non-BMP text.
Example 3 — High Then Low
Confirm adjacent units form a pair.
C#
using System;
class Program {
static void Main() {
string emoji = "\U0001F600";
bool ok = Char.IsHighSurrogate(emoji, 0) && Char.IsLowSurrogate(emoji, 1);
Console.WriteLine(ok);
Console.WriteLine(Char.IsSurrogatePair(emoji, 0));
}
}
Output
True
True
How It Works
Manual pair check. High at 0, low at 1.
Helper agrees. IsSurrogatePair also true.
Prefer the helper. IsSurrogatePair is clearer in real code.