Click or drag to resize
CharIsSurrogate Method (String, Int32)
Indicates whether the character at the specified position in a specified string has a surrogate code unit.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static bool IsSurrogate(
	string s,
	int index
)

Parameters

s
Type: SystemString
A string.
index
Type: SystemInt32
The position of the character to evaluate in s.

Return Value

Type: Boolean
true if the character at position index in s is a either a high surrogate or a low surrogate; otherwise, false.
Exceptions
ExceptionCondition
ArgumentNullExceptions is null.
ArgumentOutOfRangeExceptionindex is less than zero or greater than the last position in s.
See Also