Char: IsSurrogate

IsSurrogate

Indicates whether the specified character has a surrogate code unit.



 Public Function IsSurrogate(
	  ByVal c As Long ) As Boolean

Parameters

c
[ByVal] Long. The Unicode character to evaluate.

Return Values

Boolean -  True if c is either a high surrogate or a low surrogate; otherwise, False.

Remarks

A surrogate is a Char with a UTF-16 code unit in the range from U+D800 to U+DFFF. The individual surrogate code unit has no interpretation of its own, but has meaning only when used as part of a surrogate pair.

For more information about surrogate pairs, see the Unicode Standard at the OnlineUnicode home page.

This method handles the discrepancy between integers and longs particularly when dealing with negative integer values that should map to positive long values.

Exceptions

Exception Condition
ArgumentOutOfRangeExceptionc is outside of the valid range -32768 to 65535.

See Also

Project CorLib Overview

Class Char Overview

IsSurrogateStr

IsHighSurrogate

IsHighSurrogateStr

IsLowSurrogate

IsLowSurrogateStr