Rune Rune Rune Rune Struct

定義

表示 Unicode 純量值 ([ U+0000..U+D7FF ] (含),或 [ U+E000..U+10FFFF ] (含))。Represents a Unicode scalar value ([ U+0000..U+D7FF ], inclusive; or [ U+E000..U+10FFFF ], inclusive).

public value class Rune : IComparable<System::Text::Rune>, IEquatable<System::Text::Rune>
public struct Rune : IComparable<System.Text.Rune>, IEquatable<System.Text.Rune>
type Rune = struct
Public Structure Rune
Implements IComparable(Of Rune), IEquatable(Of Rune)
繼承
實作

備註

這種類型的函式和轉換運算子會驗證輸入,因此取用者可以呼叫 api,假設Rune基礎實例的格式正確。This type's constructors and conversion operators validate the input, so consumers can call the APIs assuming that the underlying Rune instance is well-formed.

建構函式

Rune(Char) Rune(Char) Rune(Char) Rune(Char)

從提供的 UTF-16 程式碼單位建立 RuneCreates a Rune from the provided UTF-16 code unit.

Rune(Int32) Rune(Int32) Rune(Int32) Rune(Int32)

從表示 Unicode 純量值的指定 32 位元整數建立 RuneCreates a Rune from the specified 32-bit integer that represents a Unicode scalar value.

Rune(UInt32) Rune(UInt32) Rune(UInt32) Rune(UInt32)

從表示 Unicode 純量值的指定 32 位元不帶正負號整數建立 RuneCreates a Rune from the specified 32-bit unsigned integer that represents a Unicode scalar value.

Rune(Char, Char) Rune(Char, Char) Rune(Char, Char) Rune(Char, Char)

從提供的 UTF-16 代理字組建立 RuneCreates a Rune from the provided UTF-16 surrogate pair.

屬性

IsAscii IsAscii IsAscii IsAscii

取得值,指出與此 Rune 關聯的純量值是否在 ASCII 編碼範圍內。Gets a value that indicates whether the scalar value associated with this Rune is within the ASCII encoding range.

IsBmp IsBmp IsBmp IsBmp

取得值,指出與此 Rune 關聯的純量值是否在 ASCII 編碼範圍內。Gets a value that indicates whether the scalar value associated with this Rune is within the BMP encoding range.

Plane Plane Plane Plane

取得包含此純量的 Unicode 平面 (0 到 16 (含))。Gets the Unicode plane (0 to 16, inclusive) that contains this scalar.

ReplacementChar ReplacementChar ReplacementChar ReplacementChar

取得代表 Unicode 替換字元 U+FFFD 的 Rune 執行個體。Gets a Rune instance that represents the Unicode replacement character U+FFFD.

Utf16SequenceLength Utf16SequenceLength Utf16SequenceLength Utf16SequenceLength

取得以 UTF-16 序列的字碼單位 (Char) 表示的長度,這是代表此純量值的必要項目。Gets the length in code units (Char) of the UTF-16 sequence required to represent this scalar value.

Utf8SequenceLength Utf8SequenceLength Utf8SequenceLength Utf8SequenceLength

取得以 UTF-8 序列的字碼單位表示的長度,這是代表此純量值的必要項目。Gets the length in code units of the UTF-8 sequence required to represent this scalar value.

Value Value Value Value

取得以整數表示的 Unicode 純量值。Gets the Unicode scalar value as an integer.

方法

CompareTo(Rune) CompareTo(Rune) CompareTo(Rune) CompareTo(Rune)

將目前執行個體與指定的 Rune 執行個體相比較。Compares the current instance to the specified Rune instance.

DecodeFromUtf16(ReadOnlySpan<Char>, Rune, Int32) DecodeFromUtf16(ReadOnlySpan<Char>, Rune, Int32) DecodeFromUtf16(ReadOnlySpan<Char>, Rune, Int32) DecodeFromUtf16(ReadOnlySpan<Char>, Rune, Int32)

解碼所提供 UTF-16 來源緩衝區開頭的 RuneDecodes the Rune at the beginning of the provided UTF-16 source buffer.

DecodeFromUtf8(ReadOnlySpan<Byte>, Rune, Int32) DecodeFromUtf8(ReadOnlySpan<Byte>, Rune, Int32) DecodeFromUtf8(ReadOnlySpan<Byte>, Rune, Int32) DecodeFromUtf8(ReadOnlySpan<Byte>, Rune, Int32)

解碼所提供 UTF-8 來源緩衝區開頭的 RuneDecodes the Rune at the beginning of the provided UTF-8 source buffer.

DecodeLastFromUtf16(ReadOnlySpan<Char>, Rune, Int32) DecodeLastFromUtf16(ReadOnlySpan<Char>, Rune, Int32) DecodeLastFromUtf16(ReadOnlySpan<Char>, Rune, Int32) DecodeLastFromUtf16(ReadOnlySpan<Char>, Rune, Int32)

解碼所提供 UTF-16 來源緩衝區結尾的 RuneDecodes the Rune at the end of the provided UTF-16 source buffer.

DecodeLastFromUtf8(ReadOnlySpan<Byte>, Rune, Int32) DecodeLastFromUtf8(ReadOnlySpan<Byte>, Rune, Int32) DecodeLastFromUtf8(ReadOnlySpan<Byte>, Rune, Int32) DecodeLastFromUtf8(ReadOnlySpan<Byte>, Rune, Int32)

解碼所提供 UTF-8 來源緩衝區結尾的 RuneDecodes the Rune at the end of the provided UTF-8 source buffer.

EncodeToUtf16(Span<Char>) EncodeToUtf16(Span<Char>) EncodeToUtf16(Span<Char>) EncodeToUtf16(Span<Char>)

將這個 Rune 編碼為 UTF-16 目的地緩衝區。Encodes this Rune to a UTF-16 destination buffer.

EncodeToUtf8(Span<Byte>) EncodeToUtf8(Span<Byte>) EncodeToUtf8(Span<Byte>) EncodeToUtf8(Span<Byte>)

將這個 Rune 編碼為 UTF-8 目的地緩衝區。Encodes this Rune to a UTF-8 destination buffer.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

傳回值,指出目前的執行個體與指定物件是否相等。Returns a value that indicates whether the current instance and a specified object are equal.

Equals(Rune) Equals(Rune) Equals(Rune) Equals(Rune)

傳回值,指出目前的執行個體與指定的 rune 是否相等。Returns a value that indicates whether the current instance and a specified rune are equal.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回這個執行個體的雜湊碼。Returns the hash code for this instance.

GetNumericValue(Rune) GetNumericValue(Rune) GetNumericValue(Rune) GetNumericValue(Rune)

取得與指定 rune 關聯的數值。Gets the numeric value associated with the specified rune.

GetRuneAt(String, Int32) GetRuneAt(String, Int32) GetRuneAt(String, Int32) GetRuneAt(String, Int32)

取得以字串中指定位置開頭的 RuneGets the Rune that begins at a specified position in a string.

GetUnicodeCategory(Rune) GetUnicodeCategory(Rune) GetUnicodeCategory(Rune) GetUnicodeCategory(Rune)

取得與指定 rune 關聯的 Unicode 類別。Gets the Unicode category associated with the specified rune.

IsControl(Rune) IsControl(Rune) IsControl(Rune) IsControl(Rune)

傳回值,指出指定的 rune 是否分類為控制字元。Returns a value that indicates whether the specified rune is categorized as a control character.

IsDigit(Rune) IsDigit(Rune) IsDigit(Rune) IsDigit(Rune)

傳回值,指出指定的 rune 是否分類為十進位數字。Returns a value that indicates whether the specified rune is categorized as a decimal digit.

IsLetter(Rune) IsLetter(Rune) IsLetter(Rune) IsLetter(Rune)

傳回值,指出指定的 rune 是否分類為字母。Returns a value that indicates whether the specified rune is categorized as a letter.

IsLetterOrDigit(Rune) IsLetterOrDigit(Rune) IsLetterOrDigit(Rune) IsLetterOrDigit(Rune)

傳回值,指出指定的 rune 是否分類為字母或十進位數字。Returns a value that indicates whether the specified rune is categorized as a letter or a decimal digit.

IsLower(Rune) IsLower(Rune) IsLower(Rune) IsLower(Rune)

傳回值,指出指定的 rune 是否分類為小寫字母。Returns a value that indicates whether the specified rune is categorized as a lowercase letter.

IsNumber(Rune) IsNumber(Rune) IsNumber(Rune) IsNumber(Rune)

傳回值,指出指定的 rune 是否分類為數字。Returns a value that indicates whether the specified rune is categorized as a number.

IsPunctuation(Rune) IsPunctuation(Rune) IsPunctuation(Rune) IsPunctuation(Rune)

傳回值,指出指定的 rune 是否分類為標點符號。Returns a value that indicates whether the specified rune is categorized as a punctuation mark.

IsSeparator(Rune) IsSeparator(Rune) IsSeparator(Rune) IsSeparator(Rune)

傳回值,指出指定的 rune 是否分類為分隔符號字元。Returns a value that indicates whether the specified rune is categorized as a separator character.

IsSymbol(Rune) IsSymbol(Rune) IsSymbol(Rune) IsSymbol(Rune)

傳回值,指出指定的 rune 是否分類為符號字元。Returns a value that indicates whether the specified rune is categorized as a symbol character.

IsUpper(Rune) IsUpper(Rune) IsUpper(Rune) IsUpper(Rune)

傳回值,指出指定的 rune 是否分類為大寫字母。Returns a value that indicates whether the specified rune is categorized as an uppercase letter.

IsValid(Int32) IsValid(Int32) IsValid(Int32) IsValid(Int32)

傳回值,指出 32 位元帶正負號整數是否表示有效的 Unicode 純量值;也就是位於範圍 [ U+0000..U+D7FF ] (含) 或 [ U+E000..U+10FFFF ] (含) 內。Returns a value that indicates whether a 32-bit signed integer represents a valid Unicode scalar value; that is, it is in the range [ U+0000..U+D7FF ], inclusive; or [ U+E000..U+10FFFF ], inclusive.

IsValid(UInt32) IsValid(UInt32) IsValid(UInt32) IsValid(UInt32)

傳回值,指出 32 位元不帶正負號整數是否表示有效的 Unicode 純量值;也就是位於範圍 [ U+0000..U+D7FF ] (含) 或 [ U+E000..U+10FFFF ] (含) 內。Returns a value that indicates whether a 32-bit unsigned integer represents a valid Unicode scalar value; that is, it is in the range [ U+0000..U+D7FF ], inclusive, or [ U+E000..U+10FFFF ], inclusive.

IsWhiteSpace(Rune) IsWhiteSpace(Rune) IsWhiteSpace(Rune) IsWhiteSpace(Rune)

傳回值,指出指定的 rune 是否分類為空白字元。Returns a value that indicates whether the specified rune is categorized as a white space character.

ToLower(Rune, CultureInfo) ToLower(Rune, CultureInfo) ToLower(Rune, CultureInfo) ToLower(Rune, CultureInfo)

使用指定之文化特性的駝峰式大小寫規則,傳回指定的 Rune 轉換為小寫的複本。Returns a copy of the specified Rune converted to lowercase, using the casing rules of the specified culture.

ToLowerInvariant(Rune) ToLowerInvariant(Rune) ToLowerInvariant(Rune) ToLowerInvariant(Rune)

使用不因文化特性而異的駝峰式大小寫規則,傳回指定 Rune 轉換為小寫的複本。Returns a copy of the specified Rune converted to lowercase using the casing rules of the invariant culture.

ToString() ToString() ToString() ToString()

傳回這個 Rune 執行個體的字串表示。Returns the string representation of this Rune instance.

ToUpper(Rune, CultureInfo) ToUpper(Rune, CultureInfo) ToUpper(Rune, CultureInfo) ToUpper(Rune, CultureInfo)

使用指定之文化特性的駝峰式大小寫規則,傳回指定 Rune 轉換為大寫的複本。Returns a copy of the specified Rune converted to uppercase, using the casing rules of the specified culture.

ToUpperInvariant(Rune) ToUpperInvariant(Rune) ToUpperInvariant(Rune) ToUpperInvariant(Rune)

使用不因文化特性而異的駝峰式大小寫規則,傳回指定 Rune 轉換為大寫的複本。Returns a copy of the specified Rune converted to uppercase using the casing rules of the invariant culture.

TryCreate(Char, Rune) TryCreate(Char, Rune) TryCreate(Char, Rune) TryCreate(Char, Rune)

嘗試從指定的字元建立 Rune 並傳回值,指出作業是否成功。Attempts to create a Rune from a specified character and returns a value that indicates whether the operation succeeded.

TryCreate(Int32, Rune) TryCreate(Int32, Rune) TryCreate(Int32, Rune) TryCreate(Int32, Rune)

嘗試從表示 Unicode 純量值的所指定帶正負號整數建立 RuneAttempts to create a Rune from a specified signed integer that represents a Unicode scalar value.

TryCreate(UInt32, Rune) TryCreate(UInt32, Rune) TryCreate(UInt32, Rune) TryCreate(UInt32, Rune)

嘗試從表示 Unicode 純量值的所指定 32 位元不帶正負號整數建立 RuneAttempts to create a Rune from the specified 32-bit unsigned integer that represents a Unicode scalar value.

TryCreate(Char, Char, Rune) TryCreate(Char, Char, Rune) TryCreate(Char, Char, Rune) TryCreate(Char, Char, Rune)

嘗試從指定的 UTF-16 代理字組建立 Rune 並傳回值,指出作業是否成功。Attempts to create a Rune from the specified UTF-16 surrogate pair and returns a value that indicates whether the operation was successful.

TryEncodeToUtf16(Span<Char>, Int32) TryEncodeToUtf16(Span<Char>, Int32) TryEncodeToUtf16(Span<Char>, Int32) TryEncodeToUtf16(Span<Char>, Int32)

將這個 Rune 編碼為 UTF-16 編碼目的地緩衝區。Encodes this Rune to a UTF-16 encoded destination buffer.

TryEncodeToUtf8(Span<Byte>, Int32) TryEncodeToUtf8(Span<Byte>, Int32) TryEncodeToUtf8(Span<Byte>, Int32) TryEncodeToUtf8(Span<Byte>, Int32)

將這個 Rune 編碼為 UTF-8 編碼目的地緩衝區。Encodes this Rune to a UTF-8 encoded destination buffer.

TryGetRuneAt(String, Int32, Rune) TryGetRuneAt(String, Int32, Rune) TryGetRuneAt(String, Int32, Rune) TryGetRuneAt(String, Int32, Rune)

嘗試從字串中指定位置的開頭取得 Rune 並傳回值,指出作業是否成功。Attempts to get the Rune that begins at a specified position in a string, and return a value that indicates whether the operation succeeded.

運算子

Equality(Rune, Rune) Equality(Rune, Rune) Equality(Rune, Rune) Equality(Rune, Rune)

傳回值,這個值表示兩個 Rune 執行個體是否相等。Returns a value that indicates whether two Rune instances are equal.

Explicit(Char to Rune) Explicit(Char to Rune) Explicit(Char to Rune) Explicit(Char to Rune)

定義從 16 位元 Unicode 字元到 Rune 的明確轉換。Defines an explicit conversion of a 16-bit Unicode character to a Rune.

Explicit(Int32 to Rune) Explicit(Int32 to Rune) Explicit(Int32 to Rune) Explicit(Int32 to Rune)

定義從 32 位元帶正負號的整數到 Rune 的明確轉換。Defines an explicit conversion of a 32-bit signed integer to a Rune.

Explicit(UInt32 to Rune) Explicit(UInt32 to Rune) Explicit(UInt32 to Rune) Explicit(UInt32 to Rune)

定義從 32 位元不帶正負號的整數到 Rune 的明確轉換。Defines an explicit conversion of a 32-bit unsigned integer to a Rune.

GreaterThan(Rune, Rune) GreaterThan(Rune, Rune) GreaterThan(Rune, Rune) GreaterThan(Rune, Rune)

傳回值,指出所指定的 Rune 是否大於另一個指定的 RuneReturns a value indicating whether a specified Rune is greater than another specified Rune.

GreaterThanOrEqual(Rune, Rune) GreaterThanOrEqual(Rune, Rune) GreaterThanOrEqual(Rune, Rune) GreaterThanOrEqual(Rune, Rune)

傳回值,指出所指定的 Rune 是否大於或等於另一個指定的 RuneReturns a value indicating whether a specified Rune is greater than or equal to another specified Rune.

Inequality(Rune, Rune) Inequality(Rune, Rune) Inequality(Rune, Rune) Inequality(Rune, Rune)

傳回值,指出兩個 Rune 執行個體是否有不同的值。Returns a value that indicates whether two Rune instances have different values.

LessThan(Rune, Rune) LessThan(Rune, Rune) LessThan(Rune, Rune) LessThan(Rune, Rune)

傳回值,指出所指定的 Rune 是否小於另一個指定的 RuneReturns a value indicating whether a specified Rune is less than another specified Rune.

LessThanOrEqual(Rune, Rune) LessThanOrEqual(Rune, Rune) LessThanOrEqual(Rune, Rune) LessThanOrEqual(Rune, Rune)

傳回值,指出所指定的 Rune 是否小於或等於另一個指定的 RuneReturns a value indicating whether a specified Rune is less than or equal to another specified Rune.

適用於