C# Char IsLowSurrogate(Char)
Description
Char IsLowSurrogate(Char)
indicates whether the specified
Char object is a low surrogate.
Syntax
Char.IsLowSurrogate(Char)
has the following syntax.
public static bool IsLowSurrogate(
char c
)
Parameters
Char.IsLowSurrogate(Char)
has the following parameters.
c
- The character to evaluate.
Returns
Char.IsLowSurrogate(Char)
method returns true if the numeric value of the c parameter ranges from U+DC00 through U+DFFF;
otherwise, false.
Example
The following code example demonstrates the IsLowSurrogate method.
//from w w w. ja va2 s . c o m
using System;
class Sample
{
public static void Main()
{
char cHigh = '\uD800';
char cLow = '\uDC00';
string s1 = new String(new char[] {'a', '\uD800', '\uDC00', 'z'});
Console.WriteLine("Is each of the following characters a low surrogate?");
Console.WriteLine("B1) cLow? - {0}", Char.IsLowSurrogate(cLow));
Console.WriteLine("B2) cHigh? - {0}", Char.IsLowSurrogate(cHigh));
Console.WriteLine("B3) s1[0]? - {0}", Char.IsLowSurrogate(s1, 0));
Console.WriteLine("B4) s1[2]? - {0}", Char.IsLowSurrogate(s1, 2));
}
}
The code above generates the following result.