<PackageReference Include="Microsoft.Bcl.Memory" Version="11.0.0-preview.2.26159.112" />

System.Text.Rune

Represents a Unicode scalar value ([ U+0000..U+D7FF ], inclusive; or [ U+E000..U+10FFFF ], inclusive).
public static Rune ReplacementChar { get; }

A Rune instance that represents the Unicode replacement character U+FFFD.

public bool IsAscii { get; }

Returns true if and only if this scalar value is ASCII ([ U+0000..U+007F ]) and therefore representable by a single UTF-8 code unit.

public bool IsBmp { get; }

Returns true if and only if this scalar value is within the BMP ([ U+0000..U+FFFF ]) and therefore representable by a single UTF-16 code unit.

public int Plane { get; }

Returns the Unicode plane (0 to 16, inclusive) which contains this scalar.

public int Utf16SequenceLength { get; }

Returns the length in code units ( Char) of the UTF-16 sequence required to represent this scalar value.

public int Utf8SequenceLength { get; }

Returns the length in code units of the UTF-8 sequence required to represent this scalar value.

public int Value { get; }

Returns the Unicode scalar value as an integer.

public Rune(char ch)

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

public Rune(char highSurrogate, char lowSurrogate)

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

public Rune(int value)

Creates a Rune from the provided Unicode scalar value.

public Rune(uint value)

Creates a Rune from the provided Unicode scalar value.

public static OperationStatus DecodeFromUtf16(ReadOnlySpan<char> source, out Rune result, out int charsConsumed)

Decodes the Rune at the beginning of the provided UTF-16 source buffer.

public static OperationStatus DecodeFromUtf8(ReadOnlySpan<byte> source, out Rune result, out int bytesConsumed)

Decodes the Rune at the beginning of the provided UTF-8 source buffer.

public static OperationStatus DecodeLastFromUtf16(ReadOnlySpan<char> source, out Rune result, out int charsConsumed)

Decodes the Rune at the end of the provided UTF-16 source buffer.

public static OperationStatus DecodeLastFromUtf8(ReadOnlySpan<byte> source, out Rune value, out int bytesConsumed)

Decodes the Rune at the end of the provided UTF-8 source buffer.

public static double GetNumericValue(Rune value)

public static bool IsControl(Rune value)

public static bool IsDigit(Rune value)

public static bool IsLetter(Rune value)

public static bool IsLetterOrDigit(Rune value)

public static bool IsLower(Rune value)

public static bool IsNumber(Rune value)

public static bool IsPunctuation(Rune value)

public static bool IsSeparator(Rune value)

public static bool IsSymbol(Rune value)

public static bool IsUpper(Rune value)

public static bool IsValid(int value)

Returns true iff value is a valid Unicode scalar value, i.e., is in [ U+0000..U+D7FF ], inclusive; or [ U+E000..U+10FFFF ], inclusive.

public static bool IsValid(uint value)

Returns true iff value is a valid Unicode scalar value, i.e., is in [ U+0000..U+D7FF ], inclusive; or [ U+E000..U+10FFFF ], inclusive.

public static bool IsWhiteSpace(Rune value)

public static bool op_Equality(Rune left, Rune right)

public static Rune op_Explicit(char ch)

public static Rune op_Explicit(uint value)

public static Rune op_Explicit(int value)

public static bool op_GreaterThan(Rune left, Rune right)

public static bool op_GreaterThanOrEqual(Rune left, Rune right)

public static bool op_Inequality(Rune left, Rune right)

public static bool op_LessThan(Rune left, Rune right)

public static bool op_LessThanOrEqual(Rune left, Rune right)

public static Rune ToLower(Rune value, CultureInfo culture)

public static Rune ToLowerInvariant(Rune value)

public static Rune ToUpper(Rune value, CultureInfo culture)

public static Rune ToUpperInvariant(Rune value)

public static bool TryCreate(char ch, out Rune result)

Attempts to create a Rune from the provided input value.

public static bool TryCreate(char highSurrogate, char lowSurrogate, out Rune result)

Attempts to create a Rune from the provided UTF-16 surrogate pair. Returns false if the input values don't represent a well-formed UTF-16surrogate pair.

public static bool TryCreate(int value, out Rune result)

Attempts to create a Rune from the provided input value.

public static bool TryCreate(uint value, out Rune result)

Attempts to create a Rune from the provided input value.

public int CompareTo(Rune other)

public int EncodeToUtf16(Span<char> destination)

Encodes this Rune to a UTF-16 destination buffer.

public int EncodeToUtf8(Span<byte> destination)

Encodes this Rune to a UTF-8 destination buffer.

public bool Equals(Rune other)

public bool Equals(Rune other, StringComparison comparisonType)

Returns a value that indicates whether the current instance and a specified rune are equal using the specified comparison option.

public bool TryEncodeToUtf16(Span<char> destination, out int charsWritten)

Encodes this Rune to a UTF-16 destination buffer.

public bool TryEncodeToUtf8(Span<byte> destination, out int bytesWritten)

Encodes this Rune to a destination buffer as UTF-8 bytes.