Rune Constructors

Definition

Overloads

Rune(Char)

Creates a Rune from the provided UTF-16 code unit.

Rune(Int32)

Creates a Rune from the specified 32-bit integer that represents a Unicode scalar value.

Rune(UInt32)

Creates a Rune from the specified 32-bit unsigned integer that represents a Unicode scalar value.

Rune(Char, Char)

Creates a Rune from the provided UTF-16 surrogate pair.

Rune(Char)

Source:
Rune.cs
Source:
Rune.cs
Source:
Rune.cs

Creates a Rune from the provided UTF-16 code unit.

public Rune (char ch);

Parameters

ch
Char

A UTF-16 code unit.

Exceptions

ch represents a UTF-16 surrogate code point (U+D800..U+DFFF, inclusive).

Applies to

.NET 9 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9

Rune(Int32)

Source:
Rune.cs
Source:
Rune.cs
Source:
Rune.cs

Creates a Rune from the specified 32-bit integer that represents a Unicode scalar value.

public Rune (int value);

Parameters

value
Int32

A Unicode scalar value.

Exceptions

value does not represent a Unicode scalar value.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9

Rune(UInt32)

Source:
Rune.cs
Source:
Rune.cs
Source:
Rune.cs

Important

This API is not CLS-compliant.

Creates a Rune from the specified 32-bit unsigned integer that represents a Unicode scalar value.

[System.CLSCompliant(false)]
public Rune (uint value);

Parameters

value
UInt32

A Unicode scalar value.

Attributes

Exceptions

value does not represent a Unicode scalar value.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9

Rune(Char, Char)

Source:
Rune.cs
Source:
Rune.cs
Source:
Rune.cs

Creates a Rune from the provided UTF-16 surrogate pair.

public Rune (char highSurrogate, char lowSurrogate);

Parameters

highSurrogate
Char

The high surrogate of the surrogate pair.

lowSurrogate
Char

The low surrogate of the surrogate pair.

Exceptions

highSurrogate does not represent a UTF-16 high surrogate code point.

-or-

lowSurrogate does not represent a UTF-16 low surrogate code point.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9