Char.IsLowSurrogate Method (String, Int32)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Indicates whether the Char object at the specified position in a string is a low surrogate.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

static member IsLowSurrogate : 
        s:string *
        index:int -> bool

Parameters

s
Type: System.String

A string.

index
Type: System.Int32

The position of the character to evaluate in s.

Return Value

Type: System.Boolean

true if the numeric value of the specified character in the s parameter ranges from U+DC00 through U+DFFF; otherwise, false.

Exception Condition
ArgumentNullException

s is null.

ArgumentOutOfRangeException

index is not a position within s.

The index parameter is zero-based.

In addition to representing single characters using a 16-bit code point, UTF-16 encoding allows abstract characters to be represented using two 16-bit code points, which is known as a surrogate pair. The second element in this pair is the low surrogate. Its code point can range from U+DC00 to U+DFFF. An individual surrogate has no interpretation of its own; it is meaningful only when used as part of a surrogate pair.

The following code example demonstrates the IsHighSurrogate, IsLowSurrogate, and IsSurrogatePair methods.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show: