String 類別

定義

以 UTF-16 程式代碼單位序列表示文字。

public ref class System::String sealed : IComparable, IComparable<System::String ^>, IConvertible, IEquatable<System::String ^>, System::Collections::Generic::IEnumerable<char>
public ref class System::String sealed : ICloneable, IComparable, IComparable<System::String ^>, IConvertible, IEquatable<System::String ^>, IParsable<System::String ^>, ISpanParsable<System::String ^>, System::Collections::Generic::IEnumerable<char>
public ref class System::String sealed : ICloneable, IComparable, IComparable<System::String ^>, IConvertible, IEquatable<System::String ^>, System::Collections::Generic::IEnumerable<char>
public ref class System::String sealed : ICloneable, IComparable, IConvertible, System::Collections::IEnumerable
public ref class System::String sealed : IComparable, IComparable<System::String ^>, IEquatable<System::String ^>, System::Collections::IEnumerable
public ref class System::String sealed : IComparable, IComparable<System::String ^>, IEquatable<System::String ^>, System::Collections::Generic::IEnumerable<char>
public sealed class String : IComparable, IComparable<string>, IConvertible, IEquatable<string>, System.Collections.Generic.IEnumerable<char>
public sealed class String : ICloneable, IComparable, IComparable<string>, IConvertible, IEquatable<string>, IParsable<string>, ISpanParsable<string>, System.Collections.Generic.IEnumerable<char>
public sealed class String : ICloneable, IComparable, IComparable<string>, IConvertible, IEquatable<string>, System.Collections.Generic.IEnumerable<char>
[System.Serializable]
public sealed class String : ICloneable, IComparable, IConvertible, System.Collections.IEnumerable
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class String : ICloneable, IComparable, IComparable<string>, IConvertible, IEquatable<string>, System.Collections.Generic.IEnumerable<char>
public sealed class String : IComparable, IComparable<string>, IEquatable<string>, System.Collections.IEnumerable
public sealed class String : IComparable, IComparable<string>, IEquatable<string>, System.Collections.Generic.IEnumerable<char>
type string = class
    interface seq<char>
    interface IEnumerable
    interface IComparable
    interface IComparable<string>
    interface IConvertible
    interface IEquatable<string>
type string = class
    interface seq<char>
    interface IEnumerable
    interface ICloneable
    interface IComparable
    interface IComparable<string>
    interface IConvertible
    interface IEquatable<string>
    interface IParsable<string>
    interface ISpanParsable<string>
type string = class
    interface seq<char>
    interface IEnumerable
    interface ICloneable
    interface IComparable
    interface IComparable<string>
    interface IConvertible
    interface IEquatable<string>
type string = class
    interface seq<char>
    interface IEnumerable
    interface IComparable
    interface IComparable<string>
    interface IConvertible
    interface IEquatable<string>
    interface ICloneable
[<System.Serializable>]
type string = class
    interface IComparable
    interface ICloneable
    interface IConvertible
    interface IEnumerable
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type string = class
    interface IComparable
    interface ICloneable
    interface IConvertible
    interface IComparable<string>
    interface seq<char>
    interface IEnumerable
    interface IEquatable<string>
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type string = class
    interface IComparable
    interface ICloneable
    interface IConvertible
    interface IEnumerable
    interface IComparable<string>
    interface seq<char>
    interface IEquatable<string>
type string = class
    interface IEnumerable
    interface IComparable
    interface IComparable<string>
    interface IEquatable<string>
type string = class
    interface IComparable
    interface IComparable<string>
    interface IEquatable<string>
    interface seq<char>
    interface IEnumerable
Public NotInheritable Class String
Implements IComparable, IComparable(Of String), IConvertible, IEnumerable(Of Char), IEquatable(Of String)
Public NotInheritable Class String
Implements ICloneable, IComparable, IComparable(Of String), IConvertible, IEnumerable(Of Char), IEquatable(Of String), IParsable(Of String), ISpanParsable(Of String)
Public NotInheritable Class String
Implements ICloneable, IComparable, IComparable(Of String), IConvertible, IEnumerable(Of Char), IEquatable(Of String)
Public NotInheritable Class String
Implements ICloneable, IComparable, IConvertible, IEnumerable
Public NotInheritable Class String
Implements IComparable, IComparable(Of String), IEnumerable, IEquatable(Of String)
Public NotInheritable Class String
Implements IComparable, IComparable(Of String), IEnumerable(Of Char), IEquatable(Of String)
繼承
String
屬性
實作

備註

欲了解更多關於此 API 的資訊,請參閱 String 的補充 API 備註

建構函式

名稱 Description
String(Char, Int32)

將類別的新實例 String 初始化為指定的 Unicode 字元所指示的值,重複指定次數。

String(Char[], Int32, Int32)

將類別的新實例 String 初始化為由 Unicode 字元陣列、該陣列中的起始字元位置及長度所指示的值。

String(Char[])

將類別的新實例 String 初始化為指定字元陣列中所指示的 Unicode 字元。

String(Char*, Int32, Int32)

初始化一個新的類別實例 String ,初始化為指定指標指向 Unicode 字元陣列的值、該陣列中的起始字元位置及長度。

String(Char*)

將類別的新實例 String 初始化為指定指標指向 Unicode 字元陣列所指示的值。

String(ReadOnlySpan<Char>)

將該類別的新實例 String 初始化為指定唯讀區間內所指示的 Unicode 字元。

String(SByte*, Int32, Int32, Encoding)

初始化該類別的新實例 String ,初始化為指定指標指向一個 8 位元帶號整數陣列的值、該陣列中的起始位置、長度及一個 Encoding 物件。

String(SByte*, Int32, Int32)

初始化該類別的新實例 String 為指定指標指向一個 8 位元有符號整數陣列的值、該陣列中的起始位置及長度。

String(SByte*)

將該類別的新實例 String 初始化為指向 8 位元有符號整數陣列的指標所指示的值。

欄位

名稱 Description
Empty

代表空字串。 此欄位僅供讀取。

屬性

名稱 Description
Chars[Int32]

取得 Char 物件在當前 String 物件指定位置的位置。

Length

取得目前 String 物件中的字元數。

方法

名稱 Description
Clone()

回傳此實例 String的參考。

Compare(String, Int32, String, Int32, Int32, Boolean, CultureInfo)

比較兩個指定 String 物件的子串,忽略或尊重其情況,並利用文化特定資訊影響比較,並回傳一個整數,表示它們在排序順序中的相對位置。

Compare(String, Int32, String, Int32, Int32, Boolean)

比較兩個指定 String 物件的子串,忽略或尊重它們的格,並回傳一個整數表示它們在排序順序中的相對位置。

Compare(String, Int32, String, Int32, Int32, CultureInfo, CompareOptions)

利用指定的比較選項與文化特定資訊比較兩個指定 String 物件的子串來影響比較,並回傳一個整數,表示兩個子串在排序順序中的關係。

Compare(String, Int32, String, Int32, Int32, StringComparison)

利用指定規則比較兩個指定 String 物件的子字串,並回傳一個整數,表示它們在排序順序中的相對位置。

Compare(String, Int32, String, Int32, Int32)

比較兩個指定 String 物件的子串,並回傳一個整數,表示它們在排序順序中的相對位置。

Compare(String, String, Boolean, CultureInfo)

比較兩個指定 String 物件,忽略或尊重其情況,並利用文化特定資訊影響比較,並回傳一個整數表示它們在排序順序中的相對位置。

Compare(String, String, Boolean)

比較兩個指定 String 物件,忽略或尊重其大小,並回傳一個整數,表示它們在排序順序中的相對位置。

Compare(String, String, CultureInfo, CompareOptions)

利用指定的比較選項與文化特定資訊比較兩個指定 String 物件,影響比較結果,並回傳一個整數,顯示兩字串在排序順序中的關係。

Compare(String, String, StringComparison)

使用指定規則比較兩個指定 String 物件,並回傳一個整數,表示它們在排序順序中的相對位置。

Compare(String, String)

比較兩個指定的 String 物件,並回傳一個整數,表示它們在排序順序中的相對位置。

CompareOrdinal(String, Int32, String, Int32, Int32)

透過評估兩個指定物件中對應String物件的數值,比較兩個指定Char物件的子串。

CompareOrdinal(String, String)

透過評估每個字串中對應String物件的數值,比較兩個指定Char物件。

CompareTo(Object)

比較此實例與指定的 Object 實例,並表示該實例是否在排序順序中與指定 Object實例之前、後或出現的位置相同。

CompareTo(String)

比較此實例與指定 String 物件,並指示該實例是否在排序順序中與指定字串相同位置。

Concat(IEnumerable<String>)

串接一個型態IEnumerable<T>為 的構造String集合的成員。

Concat(Object, Object, Object, Object)

串連四個指定物件的字串表示,以及選擇性可變長度參數清單中指定的任何物件。

Concat(Object, Object, Object)

串連三個指定物件的字串表示。

Concat(Object, Object)

串連兩個指定物件的字串表示。

Concat(Object)

建立指定物件的字串表示。

Concat(Object[])

串接指定陣列中 Object 元素的字串表示。

Concat(ReadOnlySpan<Char>, ReadOnlySpan<Char>, ReadOnlySpan<Char>, ReadOnlySpan<Char>)

串連四個指定唯讀字元範圍的字串表示。

Concat(ReadOnlySpan<Char>, ReadOnlySpan<Char>, ReadOnlySpan<Char>)

串連三個指定唯讀字元範圍的字串表示。

Concat(ReadOnlySpan<Char>, ReadOnlySpan<Char>)

串連兩個指定唯讀字元範圍的字串表示。

Concat(ReadOnlySpan<Object>)

串連指定之物件範圍中元素的字串表示。

Concat(ReadOnlySpan<String>)

串接指定張成 String的元素。

Concat(String, String, String, String)

串接四個指定的實例 String

Concat(String, String, String)

串接三個指定的實例 String

Concat(String, String)

串接兩個指定的實例 String

Concat(String[])

串接指定 String 陣列的元素。

Concat<T>(IEnumerable<T>)

串接實作的 IEnumerable<T> 成員。

Contains(Char, StringComparison)

回傳一個值,表示指定字元是否出現在該字串中,並使用指定的比較規則。

Contains(Char)

回傳一個值,表示指定字元是否出現在該字串中。

Contains(Rune, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

Contains(Rune)

以 UTF-16 程式代碼單位序列表示文字。

Contains(String, StringComparison)

回傳一個值,表示指定字串是否出現在該字串中,並使用指定的比較規則。

Contains(String)

回傳一個值,表示指定子字串是否出現在此字串中。

Copy(String)
已淘汰.

建立一個與指定String值相同的新實例String

CopyTo(Int32, Char[], Int32, Int32)

在此實例中,將指定數量的字元從指定位置複製到一個 Unicode 字元陣列中的指定位置。

CopyTo(Span<Char>)

將此字串的內容複製到目的區間。

Create(IFormatProvider, DefaultInterpolatedStringHandler)

透過指定的提供者來控制指定的插值字串的格式化,建立新的字串。

Create(IFormatProvider, Span<Char>, DefaultInterpolatedStringHandler)

透過指定的提供者來控制指定的插值字串的格式化,建立新的字串。

Create<TState>(Int32, TState, SpanAction<Char,TState>)

建立一個特定長度的新字串,並在建立後使用指定的回調初始化。

EndsWith(Char, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

EndsWith(Char)

判斷此字串實例的結尾是否符合指定字元。

EndsWith(Rune, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

EndsWith(Rune)

以 UTF-16 程式代碼單位序列表示文字。

EndsWith(String, Boolean, CultureInfo)

判斷該字串實例的末尾是否與指定字串相符,並使用指定的文化進行比較。

EndsWith(String, StringComparison)

透過指定的比較選項比較,判斷該字串實例的末尾是否與指定字串相符。

EndsWith(String)

判斷此字串實例的結尾是否與指定字串相符。

EnumerateRunes()

從此字串回傳一個 Rune 枚舉。

Equals(Object)

判斷此實例與指定物件(必須同時也是 String 物件)值是否相同。

Equals(String, String, StringComparison)

判斷兩個指定 String 物件的值是否相同。 參數指定比較中使用的文化、案例及排序規則。

Equals(String, String)

判斷兩個指定 String 物件的值是否相同。

Equals(String, StringComparison)

判斷此字串與指定 String 物件值是否相同。 參數指定比較中使用的文化、案例及排序規則。

Equals(String)

判斷此實例與另一個指定 String 物件是否具有相同值。

Format(IFormatProvider, CompositeFormat, Object[])

以指定格式中對應物件的字串表示來取代格式 CompositeFormat 項目。

Format(IFormatProvider, CompositeFormat, ReadOnlySpan<Object>)

以指定格式中對應物件的字串表示來取代格式 CompositeFormat 項目。

Format(IFormatProvider, String, Object, Object, Object)

將字串中的格式專案取代為三個指定物件的字串表示。 參數提供特定文化特性的格式資訊。

Format(IFormatProvider, String, Object, Object)

將字串中的格式專案取代為兩個指定物件的字串表示。 參數提供特定文化特性的格式資訊。

Format(IFormatProvider, String, Object)

將指定字串中的格式專案或專案取代為對應物件的字串表示。 參數提供特定文化特性的格式資訊。

Format(IFormatProvider, String, Object[])

將字串中的格式專案取代為指定數位中對應物件的字串表示。 參數提供特定文化特性的格式資訊。

Format(IFormatProvider, String, ReadOnlySpan<Object>)

將字串中的格式專案取代為指定範圍中對應物件的字串表示。 參數提供特定文化特性的格式資訊。

Format(String, Object, Object, Object)

將字串中的格式專案取代為三個指定物件的字串表示。

Format(String, Object, Object)

將字串中的格式專案取代為兩個指定物件的字串表示。

Format(String, Object)

以指定物件的字串表示取代字串中的一或多個格式專案。

Format(String, Object[])

將指定字串中的格式專案取代為指定數位中對應物件的字串表示。

Format(String, ReadOnlySpan<Object>)

將指定字串中的格式專案取代為指定範圍中對應物件的字串表示。

Format<TArg0,TArg1,TArg2>(IFormatProvider, CompositeFormat, TArg0, TArg1, TArg2)

以指定格式中對應物件的字串表示來取代格式 CompositeFormat 項目。

Format<TArg0,TArg1>(IFormatProvider, CompositeFormat, TArg0, TArg1)

以指定格式中對應物件的字串表示來取代格式 CompositeFormat 項目。

Format<TArg0>(IFormatProvider, CompositeFormat, TArg0)

以指定格式中對應物件的字串表示來取代格式 CompositeFormat 項目。

GetEnumerator()

取得一個物件,可以遍歷該字串中的各個字元。

GetHashCode()

回傳此字串的雜湊碼。

GetHashCode(ReadOnlySpan<Char>, StringComparison)

會依照指定規則回傳該只讀字元區間的雜湊碼。

GetHashCode(ReadOnlySpan<Char>)

回傳所提供唯讀字元區間的雜湊碼。

GetHashCode(StringComparison)

會依照指定規則回傳此字串的雜湊碼。

GetPinnableReference()

回傳指向字串中索引為零的元素的參考。

此方法旨在支援 .NET 編譯器,並非使用者程式碼所呼叫。

GetType()

取得目前實例的 Type

(繼承來源 Object)
GetTypeCode()

退還課程TypeCodeString

IndexOf(Char, Int32, Int32, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

IndexOf(Char, Int32, Int32)

報告此時指定字元首次出現的零為基礎索引。 搜尋從指定的字元位置開始,並檢視指定數量的字元位置。

IndexOf(Char, Int32, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

IndexOf(Char, Int32)

報告該字串中指定 Unicode 字元首次出現的以零為基礎的索引。 搜尋從指定的字元位置開始。

IndexOf(Char, StringComparison)

報告該字串中指定 Unicode 字元首次出現的以零為基礎的索引。 參數指定該字元應使用的搜尋類型。

IndexOf(Char)

報告該字串中指定 Unicode 字元首次出現的以零為基礎的索引。

IndexOf(Rune, Int32, Int32, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

IndexOf(Rune, Int32, Int32)

以 UTF-16 程式代碼單位序列表示文字。

IndexOf(Rune, Int32, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

IndexOf(Rune, Int32)

以 UTF-16 程式代碼單位序列表示文字。

IndexOf(Rune, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

IndexOf(Rune)

以 UTF-16 程式代碼單位序列表示文字。

IndexOf(String, Int32, Int32, StringComparison)

報告指定字串首次出現於當前 String 物件的零為基礎索引。 參數會指定當前字串的起始搜尋位置、目前字串中可搜尋的字元數,以及該字串所要使用的搜尋類型。

IndexOf(String, Int32, Int32)

報告該字串在此實例中首次出現的零為基礎的索引。 搜尋從指定的字元位置開始,並檢視指定數量的字元位置。

IndexOf(String, Int32, StringComparison)

報告指定字串首次出現於當前 String 物件的零為基礎索引。 參數指定當前字串的起始搜尋位置及指定字串所用的搜尋類型。

IndexOf(String, Int32)

報告該字串在此實例中首次出現的零為基礎的索引。 搜尋從指定的字元位置開始。

IndexOf(String, StringComparison)

報告指定字串首次出現於當前 String 物件的零為基礎索引。 參數會指定要用於指定字串的搜尋類型。

IndexOf(String)

報告該字串在此實例中首次出現的零為基礎的索引。

IndexOfAny(Char[], Int32, Int32)

報告此例中任意 Unicode 字元陣列中首次出現的零為基礎索引。 搜尋從指定的字元位置開始,並檢視指定數量的字元位置。

IndexOfAny(Char[], Int32)

報告此例中任意 Unicode 字元陣列中首次出現的零為基礎索引。 搜尋從指定的字元位置開始。

IndexOfAny(Char[])

報告此例中任意 Unicode 字元陣列中首次出現的零為基礎索引。

Insert(Int32, String)

回傳一個新字串,該字串在此實例中插入指定的字串於指定索引位置。

Intern(String)

取得系統對指定 String的參考。

IsInterned(String)

取得指定 String的參考。

IsNormalized()

表示此字串是否屬於 Unicode 正規化形式 C。

IsNormalized(NormalizationForm)

表示此字串是否屬於指定的 Unicode 正規化形式。

IsNullOrEmpty(String)

表示指定的字串 null 是空字串(「」)。

IsNullOrWhiteSpace(String)

表示指定字串 null是空字串,還是僅包含空白字元。

Join(Char, Object[])

使用每個成員之間的指定分隔符,串連 物件陣列的字串表示。

Join(Char, ReadOnlySpan<Object>)

使用每個成員之間的指定分隔符,串連物件範圍的字串表示。

Join(Char, ReadOnlySpan<String>)

使用每個成員之間的指定分隔符,串連字串範圍。

Join(Char, String[], Int32, Int32)

串接一組字串,使用每個成員間指定的分隔符,從位於該value位置的元素startIndex開始,串接至count元素。

Join(Char, String[])

使用每個成員之間的指定分隔符串連字串陣列。

Join(String, IEnumerable<String>)

利用指定的分隔符串接一個型別IEnumerable<T>為 的構造String集合的成員。

Join(String, Object[])

使用每個項目之間的指定分隔符,串連物件數位的專案。

Join(String, ReadOnlySpan<Object>)

使用每個成員之間的指定分隔符,串連物件範圍的字串表示。

Join(String, ReadOnlySpan<String>)

使用每個成員之間的指定分隔符,串連字串範圍。

Join(String, String[], Int32, Int32)

使用每個元素之間的指定分隔符,串連字串陣列的指定專案。

Join(String, String[])

使用每個元素之間的指定分隔符,串連字串陣列的所有元素。

Join<T>(Char, IEnumerable<T>)

使用每個成員之間的指定分隔符,串連集合的成員。

Join<T>(String, IEnumerable<T>)

使用每個成員之間的指定分隔符,串連集合的成員。

LastIndexOf(Char, Int32, Int32, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

LastIndexOf(Char, Int32, Int32)

報告這個實例中子字串中最後一個出現之 Unicode 字元之以零起始的索引位置。 搜尋會從指定的字元位置開始,然後嚮往回嚮往字串開頭,以取得指定數目的字元位置。

LastIndexOf(Char, Int32, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

LastIndexOf(Char, Int32)

報告這個實例中指定 Unicode 字元最後一次出現之以零起始的索引位置。 搜尋會從指定的字元位置開始,然後嚮往字串開頭。

LastIndexOf(Char, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

LastIndexOf(Char)

報告這個實例中指定 Unicode 字元最後一次出現之以零起始的索引位置。

LastIndexOf(Rune, Int32, Int32, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

LastIndexOf(Rune, Int32, Int32)

以 UTF-16 程式代碼單位序列表示文字。

LastIndexOf(Rune, Int32, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

LastIndexOf(Rune, Int32)

以 UTF-16 程式代碼單位序列表示文字。

LastIndexOf(Rune, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

LastIndexOf(Rune)

以 UTF-16 程式代碼單位序列表示文字。

LastIndexOf(String, Int32, Int32, StringComparison)

報告這個實例中最後一個出現指定字串之以零起始的索引位置。 搜尋會從指定的字元位置開始,然後嚮往回嚮往字串開頭,以取得指定的字元位置數目。 參數會指定搜尋指定字串時要執行的比較類型。

LastIndexOf(String, Int32, Int32)

報告這個實例中最後一個出現指定字串之以零起始的索引位置。 搜尋會從指定的字元位置開始,然後嚮往回嚮往字串開頭,以取得指定數目的字元位置。

LastIndexOf(String, Int32, StringComparison)

報告指定字串在當前 String 物件中最後一次出現的零為基礎的索引。 搜尋會從指定的字元位置開始,然後嚮往字串開頭。 參數會指定搜尋指定字串時要執行的比較類型。

LastIndexOf(String, Int32)

報告這個實例中最後一個出現指定字串之以零起始的索引位置。 搜尋會從指定的字元位置開始,然後嚮往字串開頭。

LastIndexOf(String, StringComparison)

報告指定字串在當前 String 物件中最後一次出現的零為基礎的索引。 參數會指定要用於指定字串的搜尋類型。

LastIndexOf(String)

報告這個實例中最後一個出現指定字串之以零起始的索引位置。

LastIndexOfAny(Char[], Int32, Int32)

報告 Unicode 陣列中一個或多個字元最後一次出現時的零為基礎索引位置。 搜尋會從指定的字元位置開始,然後嚮往回嚮往字串開頭,以取得指定數目的字元位置。

LastIndexOfAny(Char[], Int32)

報告 Unicode 陣列中一個或多個字元最後一次出現時的零為基礎索引位置。 搜尋會從指定的字元位置開始,然後嚮往字串開頭。

LastIndexOfAny(Char[])

報告 Unicode 陣列中一個或多個字元最後一次出現時的零為基礎索引位置。

MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
Normalize()

回傳一個新字串,其文本值與此字串相同,但其二進位表示為 Unicode 正規化形式 C。

Normalize(NormalizationForm)

回傳一個新字串,其文本值與此字串相同,但其二進位表示為指定的 Unicode 正規化形式。

PadLeft(Int32, Char)

回傳一個新字串,透過在左側用指定的 Unicode 字元填充字元,使字元右對齊,達到指定的總長度。

PadLeft(Int32)

回傳一個新字串,透過在左側用空格填充字元,將字元右對齊,並設定指定的總長度。

PadRight(Int32, Char)

回傳一個新字串,透過在右側用指定的 Unicode 字元填充字元,使字元左對齊,達到指定的總長度。

PadRight(Int32)

回傳一個新字串,透過在右側用空格填充字元,使字元左對齊,並設定指定的總長度。

Remove(Int32, Int32)

回傳一個新字串,該字串中已刪除當前實例中從指定位置開始的指定字元數。

Remove(Int32)

回傳一個新字串,該字串中目前實例中從指定位置開始並一直到最後一個位置的所有字元都已被刪除。

Replace(Char, Char)

回傳一個新字串,該字串中該實例中指定 Unicode 字元的所有出現都被替換為另一個指定的 Unicode 字元。

Replace(Rune, Rune)

以 UTF-16 程式代碼單位序列表示文字。

Replace(String, String, Boolean, CultureInfo)

回傳一個新字串,將當前實例中指定字串的所有出現都替換為另一個指定字串,使用提供的文化與大小寫敏感度。

Replace(String, String, StringComparison)

回傳一個新字串,將當前實例中指定字串的所有出現都替換為另一個指定的字串,並使用提供的比較型別。

Replace(String, String)

回傳一個新字串,將當前實例中指定字串的所有出現都被替換為另一個指定的字串。

ReplaceLineEndings()

將目前字串中所有換行序列替換為 NewLine

ReplaceLineEndings(String)

將目前字串中所有換行序列替換為 replacementText

Split(Char, Int32, StringSplitOptions)

根據提供的字元分隔符,將字串分割成最大子字串數目,選擇性地省略結果中的空白子字串。

Split(Char, StringSplitOptions)

根據指定的分隔字元,將字串分割成子字串,並選擇性地將字串分割成子字串。

Split(Char[], Int32, StringSplitOptions)

根據指定的分隔字元和選擇性選項,將字串分割成最大子字串數目。

Split(Char[], Int32)

根據指定的分隔字元,將字串分割成最大子字串數目。

Split(Char[], StringSplitOptions)

根據指定的分隔字元和選項,將字串分割成子字串。

Split(Char[])

根據指定的分隔字元,將字串分割成子字串。

Split(ReadOnlySpan<Char>)

根據指定的分隔字元,將字串分割成子字串。

Split(Rune, Int32, StringSplitOptions)

以 UTF-16 程式代碼單位序列表示文字。

Split(Rune, StringSplitOptions)

以 UTF-16 程式代碼單位序列表示文字。

Split(String, Int32, StringSplitOptions)

根據指定的分隔字串,將字串分割成最大子字串數目,並選擇性地將字串分割成最大數目。

Split(String, StringSplitOptions)

將字串分割成以提供的字串分隔符為基礎的子字串。

Split(String[], Int32, StringSplitOptions)

根據指定的分隔字串和選擇性選項,將字串分割成子字串數目上限。

Split(String[], StringSplitOptions)

根據指定的分隔字串,將字串分割成子字串串,並選擇性地將字串分割成子字串。

StartsWith(Char, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

StartsWith(Char)

判斷此字串實例是否以指定字元開頭。

StartsWith(Rune, StringComparison)

以 UTF-16 程式代碼單位序列表示文字。

StartsWith(Rune)

以 UTF-16 程式代碼單位序列表示文字。

StartsWith(String, Boolean, CultureInfo)

判斷該字串實例的開頭是否與指定字串相符,並使用指定的文化進行比較。

StartsWith(String, StringComparison)

透過指定的比較選項,判斷該字串實例的開頭是否與指定字串相符。

StartsWith(String)

判斷此字串實例的開頭是否與指定字串相符。

Substring(Int32, Int32)

從此實例中擷取一個子字串。 子字串從指定的字元位置開始,並具有指定的長度。

Substring(Int32)

從此實例中擷取一個子字串。 子字串從指定的字元位置開始,並一直延伸到字串的末尾。

ToCharArray()

將此處的字元複製到 Unicode 字元陣列。

ToCharArray(Int32, Int32)

在此實例中,將指定子串中的字元複製到 Unicode 字元陣列。

ToLower()

回傳該字串的轉為小寫的副本。

ToLower(CultureInfo)

回傳該字串的副本,轉換為小寫,並依照指定文化的大小寫規則。

ToLowerInvariant()

回傳此物件的副本 String ,並使用不變培養的大小寫規則轉換為小寫。

ToString()

回傳此實例 String;未進行實際轉換。

ToString(IFormatProvider)

回傳此實例 String;未進行實際轉換。

ToUpper()

回傳該字串的複製品,已轉換為大寫字母。

ToUpper(CultureInfo)

回傳該字串的複製品,並依照指定文化的大小寫規則轉換為大寫字母。

ToUpperInvariant()

回傳該物件的副本 String ,並依照不變培養的格式規則轉換為大寫字母。

Trim()

移除目前字串中所有前置與後方空白字元。

Trim(Char)

移除目前字串中所有前後字元的實例。

Trim(Char[])

從目前字串中移除陣列中指定的一組字元的所有前後出現。

Trim(Rune)

以 UTF-16 程式代碼單位序列表示文字。

TrimEnd()

從目前字串中移除所有尾端空格符。

TrimEnd(Char)

從目前字串中移除字元的所有尾端專案。

TrimEnd(Char[])

從目前字串中移除陣列中指定的一組字元的所有尾端專案。

TrimEnd(Rune)

以 UTF-16 程式代碼單位序列表示文字。

TrimStart()

從目前字串中移除所有前置空格符。

TrimStart(Char)

從目前字串中移除指定字元的所有前置專案。

TrimStart(Char[])

從目前字串中移除陣列中指定的一組字元的所有前置專案。

TrimStart(Rune)

以 UTF-16 程式代碼單位序列表示文字。

TryCopyTo(Span<Char>)

將此字串的內容複製到目的區間。

操作員

名稱 Description
Equality(String, String)

判斷兩個指定字串的值是否相同。

Implicit(String to ReadOnlySpan<Char>)

定義了將特定字串隱含轉換為唯讀字元區段的方法。

Inequality(String, String)

判斷兩個指定字串的值是否不同。

明確介面實作

名稱 Description
IComparable.CompareTo(Object)

比較此實例與指定的 Object 實例,並表示該實例是否在排序順序中與指定 Object實例之前、後或出現的位置相同。

IConvertible.GetTypeCode()

退還課程TypeCodeString

IConvertible.ToBoolean(IFormatProvider)

關於此成員的描述,請參見 ToBoolean(IFormatProvider)

IConvertible.ToByte(IFormatProvider)

關於此成員的描述,請參見 ToByte(IFormatProvider)

IConvertible.ToChar(IFormatProvider)

關於此成員的描述,請參見 ToChar(IFormatProvider)

IConvertible.ToDateTime(IFormatProvider)

關於此成員的描述,請參見 ToDateTime(IFormatProvider)

IConvertible.ToDecimal(IFormatProvider)

關於此成員的描述,請參見 ToDecimal(IFormatProvider)

IConvertible.ToDouble(IFormatProvider)

關於此成員的描述,請參見 ToDouble(IFormatProvider)

IConvertible.ToInt16(IFormatProvider)

關於此成員的描述,請參見 ToInt16(IFormatProvider)

IConvertible.ToInt32(IFormatProvider)

關於此成員的描述,請參見 ToInt32(IFormatProvider)

IConvertible.ToInt64(IFormatProvider)

關於此成員的描述,請參見 ToInt64(IFormatProvider)

IConvertible.ToSByte(IFormatProvider)

關於此成員的描述,請參見 ToSByte(IFormatProvider)

IConvertible.ToSingle(IFormatProvider)

關於此成員的描述,請參見 ToSingle(IFormatProvider)

IConvertible.ToString(IFormatProvider)

關於此成員的描述,請參見 ToString(IFormatProvider)

IConvertible.ToType(Type, IFormatProvider)

關於此成員的描述,請參見 ToType(Type, IFormatProvider)

IConvertible.ToUInt16(IFormatProvider)

關於此成員的描述,請參見 ToUInt16(IFormatProvider)

IConvertible.ToUInt32(IFormatProvider)

關於此成員的描述,請參見 ToUInt32(IFormatProvider)

IConvertible.ToUInt64(IFormatProvider)

關於此成員的描述,請參見 ToUInt64(IFormatProvider)

IEnumerable.GetEnumerator()

回傳一個列舉子,會遍歷目前的 String 物件。

IEnumerable<Char>.GetEnumerator()

回傳一個列舉子,會遍歷目前的 String 物件。

IParsable<String>.Parse(String, IFormatProvider)

將字串剖析成值。

IParsable<String>.TryParse(String, IFormatProvider, String)

以 UTF-16 程式代碼單位序列表示文字。

ISpanParsable<String>.Parse(ReadOnlySpan<Char>, IFormatProvider)

將字元範圍剖析為值。

ISpanParsable<String>.TryParse(ReadOnlySpan<Char>, IFormatProvider, String)

以 UTF-16 程式代碼單位序列表示文字。

擴充方法

名稱 Description
Aggregate<TSource,TAccumulate,TResult>(IEnumerable<TSource>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, Func<TAccumulate,TResult>)

在序列上套用累加器函式。 指定的種子值會當做初始累加器值使用,而指定的函式則用來選取結果值。

Aggregate<TSource,TAccumulate>(IEnumerable<TSource>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>)

在序列上套用累加器函式。 指定的種子值會當做初始累加器值使用。

Aggregate<TSource>(IEnumerable<TSource>, Func<TSource,TSource,TSource>)

在序列上套用累加器函式。

AggregateBy<TSource,TKey,TAccumulate>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TKey,TAccumulate>, Func<TAccumulate,TSource,TAccumulate>, IEqualityComparer<TKey>)

對序列套用累加函數,依鍵分組結果。

AggregateBy<TSource,TKey,TAccumulate>(IEnumerable<TSource>, Func<TSource, TKey>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, IEqualityComparer<TKey>)

對序列套用累加函數,依鍵分組結果。

All<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

判斷序列的所有專案是否符合條件。

Ancestors<T>(IEnumerable<T>, XName)

傳回元素的篩選集合,其中包含來源集合中每個節點的上階。 集合中只會包含具有相符 XName 的專案。

Ancestors<T>(IEnumerable<T>)

傳回專案集合,其中包含來源集合中每個節點的上階。

Any<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

判斷序列的任何專案是否符合條件。

Any<TSource>(IEnumerable<TSource>)

判斷序列是否包含任何專案。

Append<TSource>(IEnumerable<TSource>, TSource)

將值附加至序列結尾。

AsEnumerable<TSource>(IEnumerable<TSource>)

傳回 IEnumerable<T> 類型的輸入。

AsMemory(String, Index)

在目標字串的某個部分上建立新 ReadOnlyMemory<Char> 索引,從指定索引開始。

AsMemory(String, Int32, Int32)

在目標字串的一段位置以長度開始的部分建立新 ReadOnlyMemory<Char> 字串。

AsMemory(String, Int32)

在目標字串的某個部分,從指定字元位置開始建立新 ReadOnlyMemory<Char> 字串。

AsMemory(String, Range)

在目標字串的特定範圍內建立新 ReadOnlyMemory<Char> 一個。

AsMemory(String)

在目標字串的部分建立新的 ReadOnlyMemory<Char>

AsParallel(IEnumerable)

啟用查詢的平行處理。

AsParallel<TSource>(IEnumerable<TSource>)

啟用查詢的平行處理。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

AsQueryable<TElement>(IEnumerable<TElement>)

將泛型 IEnumerable<T> 轉換成泛型 IQueryable<T>

AsSpan(String, Index)

從指定位置到字串末端,在目標字串的一部分上建立新 ReadOnlySpan<T> 字串。

AsSpan(String, Int32, Int32)

從指定位置建立目標字串部分的只讀區間,且需特定字元數。

AsSpan(String, Int32)

建立一個新的唯讀區間,涵蓋目標字串從指定位置到字串末端的部分。

AsSpan(String, Range)

利用範圍起始與結束索引,在目標字串的一部分上建立新資料 ReadOnlySpan<T>

AsSpan(String)

在字串上建立一個新的唯讀區間。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

計算 Decimal 值序列的平均值,這些值是在輸入序列的每個元素上叫用轉換函式所取得。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

計算 Double 值序列的平均值,這些值是在輸入序列的每個元素上叫用轉換函式所取得。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

計算 Int32 值序列的平均值,這些值是在輸入序列的每個元素上叫用轉換函式所取得。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

計算 Int64 值序列的平均值,這些值是在輸入序列的每個元素上叫用轉換函式所取得。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

計算在輸入序列的每個元素上叫用轉換函式所取得之可為 Null Decimal 值序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

計算在輸入序列的每個元素上叫用轉換函式所取得之可為 Null Double 值序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

計算在輸入序列的每個元素上叫用轉換函式所取得之可為 Null Int32 值序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

計算在輸入序列的每個元素上叫用轉換函式所取得之可為 Null Int64 值序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

計算在輸入序列的每個元素上叫用轉換函式所取得之可為 Null Single 值序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

計算 Single 值序列的平均值,這些值是在輸入序列的每個元素上叫用轉換函式所取得。

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

Chunk<TSource>(IEnumerable<TSource>, Int32)

將序列的專案分割成大社區塊,最多 size

Concat<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

串連兩個序列。

Contains<TSource>(IEnumerable<TSource>, TSource, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T>,判斷序列是否包含指定的專案。

Contains<TSource>(IEnumerable<TSource>, TSource)

判斷序列是否使用預設相等比較子來包含指定的專案。

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

DataRow 物件複製到指定的 DataTable,指定輸入 IEnumerable<T> 物件,其中泛型參數 TDataRow

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

DataRow 物件複製到指定的 DataTable,指定輸入 IEnumerable<T> 物件,其中泛型參數 TDataRow

CopyToDataTable<T>(IEnumerable<T>)

傳回包含 DataTable 物件複本的 DataRow,指定泛型參數 IEnumerable<T>T的輸入 DataRow 物件。

Count<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回數位,代表指定序列中滿足條件的項目數目。

Count<TSource>(IEnumerable<TSource>)

傳回序列中的項目數目。

CountBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

回傳來源序列中依鍵分組的元素數量。

DefaultIfEmpty<TSource>(IEnumerable<TSource>, TSource)

如果序列是空的,則傳回指定序列的專案或單一集合中的指定值。

DefaultIfEmpty<TSource>(IEnumerable<TSource>)

如果序列是空的,則傳回指定序列的專案或單一集合中型別參數的預設值。

DescendantNodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和專案之子代節點的集合。

Descendants<T>(IEnumerable<T>, XName)

傳回篩選的專案集合,其中包含來源集合中每個元素和檔的子代專案。 集合中只會包含具有相符 XName 的專案。

Descendants<T>(IEnumerable<T>)

傳回專案集合,其中包含來源集合中每個元素和檔的子代專案。

Distinct<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T> 來比較值,從序列傳回不同的專案。

Distinct<TSource>(IEnumerable<TSource>)

使用預設相等比較子來比較值,從序列傳回不同的專案。

DistinctBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式,並使用指定的比較子來比較索引鍵,從序列傳回不同的專案。

DistinctBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,從序列傳回不同的專案。

ElementAt<TSource>(IEnumerable<TSource>, Index)

傳回序列中指定索引處的專案。

ElementAt<TSource>(IEnumerable<TSource>, Int32)

傳回序列中指定索引處的專案。

ElementAtOrDefault<TSource>(IEnumerable<TSource>, Index)

傳回序列中指定索引處的專案,如果索引超出範圍,則傳回預設值。

ElementAtOrDefault<TSource>(IEnumerable<TSource>, Int32)

傳回序列中指定索引處的專案,如果索引超出範圍,則傳回預設值。

Elements<T>(IEnumerable<T>, XName)

傳回來源集合中每個專案和檔之子項目的篩選集合。 集合中只會包含具有相符 XName 的專案。

Elements<T>(IEnumerable<T>)

傳回來源集合中每個專案和檔的子專案集合。

Except<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T> 來比較值,產生兩個序列的集合差異。

Except<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

使用預設相等比較子來比較值,產生兩個序列的集合差異。

ExceptBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式,產生兩個序列的集合差異。

ExceptBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,產生兩個序列的集合差異。

First<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回序列中符合指定條件的第一個專案。

First<TSource>(IEnumerable<TSource>)

傳回序列的第一個專案。

FirstOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>, TSource)

傳回序列中符合條件的第一個專案,如果沒有找到這類專案,則傳回指定的預設值。

FirstOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回序列的第一個專案,如果找不到這類專案,則為符合條件或預設值。

FirstOrDefault<TSource>(IEnumerable<TSource>, TSource)

傳回序列的第一個專案,如果序列不包含任何專案,則傳回指定的預設值。

FirstOrDefault<TSource>(IEnumerable<TSource>)

傳回序列的第一個專案,如果序列不包含任何專案,則傳回預設值。

GroupBy<TSource,TKey,TElement,TResult>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable<TElement>, TResult>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式,將序列的專案分組,並從每個群組及其索引鍵建立結果值。 索引鍵值是使用指定的比較子來比較,而每個群組的元素都是使用指定的函式來投影。

GroupBy<TSource,TKey,TElement,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable<TElement>,TResult>)

根據指定的索引鍵選取器函式,將序列的專案分組,並從每個群組及其索引鍵建立結果值。 每個群組的項目都會使用指定的函式來投影。

GroupBy<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

根據索引鍵選取器函式,將序列的專案分組。 索引鍵是使用比較子來比較,而且每個群組的元素都是使用指定的函式來投影。

GroupBy<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

根據指定的索引鍵選取器函式將序列的專案分組,並使用指定的函式來投影每個群組的專案。

GroupBy<TSource,TKey,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,IEnumerable<TSource>,TResult>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式,將序列的專案分組,並從每個群組及其索引鍵建立結果值。 使用指定的比較子來比較索引鍵。

GroupBy<TSource,TKey,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,IEnumerable<TSource>,TResult>)

根據指定的索引鍵選取器函式,將序列的專案分組,並從每個群組及其索引鍵建立結果值。

GroupBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式將序列的專案分組,並使用指定的比較子比較索引鍵。

GroupBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,將序列的專案分組。

GroupJoin<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,IEnumerable<TInner>, TResult>, IEqualityComparer<TKey>)

根據索引鍵相等將兩個序列的專案相互關聯,並將結果分組。 指定的 IEqualityComparer<T> 可用來比較索引鍵。

GroupJoin<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,IEnumerable<TInner>, TResult>)

根據索引鍵的相等性,將兩個序列的專案相互關聯,並將結果分組。 默認相等比較子可用來比較索引鍵。

Index<TSource>(IEnumerable<TSource>)

傳回可列舉,將元素的索引併入 Tuple 中。

InDocumentOrder<T>(IEnumerable<T>)

傳回包含來源集合中所有節點的節點集合,依檔順序排序。

Intersect<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T> 來比較值,產生兩個序列的集合交集。

Intersect<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

使用預設相等比較子比較值來產生兩個序列的集合交集。

IntersectBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式,產生兩個序列的集合交集。

IntersectBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,產生兩個序列的集合交集。

IsNormalized(String, NormalizationForm)

表示字串是否屬於指定的 Unicode 正規化形式。

IsNormalized(String)

表示指定的字串是否採用 Unicode 正規化形式 C。

Join<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,TInner,TResult>, IEqualityComparer<TKey>)

根據匹配的鍵數關聯兩個序列的元素。 指定的 IEqualityComparer<T> 可用來比較索引鍵。

Join<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,TInner,TResult>)

根據匹配的鍵數關聯兩個序列的元素。 默認相等比較子可用來比較索引鍵。

Last<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回符合指定條件之序列的最後一個專案。

Last<TSource>(IEnumerable<TSource>)

傳回序列的最後一個專案。

LastOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>, TSource)

傳回符合條件之序列的最後一個專案,如果沒有找到這類專案,則傳回指定的預設值。

LastOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回序列的最後一個專案,如果找不到這類專案,則為符合條件或預設值。

LastOrDefault<TSource>(IEnumerable<TSource>, TSource)

傳回序列的最後一個專案,如果序列不包含任何專案,則傳回指定的預設值。

LastOrDefault<TSource>(IEnumerable<TSource>)

傳回序列的最後一個專案,如果序列不包含任何專案,則傳回預設值。

LeftJoin<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,TInner,TResult>, IEqualityComparer<TKey>)

根據匹配的鍵數關聯兩個序列的元素。 指定的 IEqualityComparer<T> 可用來比較索引鍵。

LeftJoin<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,TInner,TResult>)

根據匹配的鍵數關聯兩個序列的元素。 默認相等比較子可用來比較索引鍵。

LongCount<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回 Int64,代表序列中滿足條件的項目數目。

LongCount<TSource>(IEnumerable<TSource>)

傳回代表序列中項目總數的 Int64

Max<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

在泛型序列的每個專案上叫用轉換函式,並傳回產生的最大值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

在序列的每個元素上叫用轉換函式,並傳回最大 Decimal 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

在序列的每個元素上叫用轉換函式,並傳回最大 Double 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

在序列的每個元素上叫用轉換函式,並傳回最大 Int32 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

在序列的每個元素上叫用轉換函式,並傳回最大 Int64 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

在序列的每個元素上叫用轉換函式,並傳回可為 Null 的最大 Decimal 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

在序列的每個元素上叫用轉換函式,並傳回可為 Null 的最大 Double 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

在序列的每個元素上叫用轉換函式,並傳回可為 Null 的最大 Int32 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

在序列的每個元素上叫用轉換函式,並傳回可為 Null 的最大 Int64 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

在序列的每個元素上叫用轉換函式,並傳回可為 Null 的最大 Single 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

在序列的每個元素上叫用轉換函式,並傳回最大 Single 值。

Max<TSource>(IEnumerable<TSource>, IComparer<TSource>)

傳回泛型序列中的最大值。

Max<TSource>(IEnumerable<TSource>)

傳回泛型序列中的最大值。

MaxBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

根據指定的索引鍵選取器函式和索引鍵比較子,傳回泛型序列中的最大值。

MaxBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,傳回泛型序列中的最大值。

Min<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

在泛型序列的每個專案上叫用轉換函式,並傳回產生的最小值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

在序列的每個元素上叫用轉換函式,並傳回最小值 Decimal 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

在序列的每個元素上叫用轉換函式,並傳回最小值 Double 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

在序列的每個元素上叫用轉換函式,並傳回最小值 Int32 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

在序列的每個元素上叫用轉換函式,並傳回最小值 Int64 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

在序列的每個專案上叫用轉換函式,並傳回可為 null 的最小值 Decimal 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

在序列的每個專案上叫用轉換函式,並傳回可為 null 的最小值 Double 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

在序列的每個專案上叫用轉換函式,並傳回可為 null 的最小值 Int32 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

在序列的每個專案上叫用轉換函式,並傳回可為 null 的最小值 Int64 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

在序列的每個專案上叫用轉換函式,並傳回可為 null 的最小值 Single 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

在序列的每個元素上叫用轉換函式,並傳回最小值 Single 值。

Min<TSource>(IEnumerable<TSource>, IComparer<TSource>)

傳回泛型序列中的最小值。

Min<TSource>(IEnumerable<TSource>)

傳回泛型序列中的最小值。

MinBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

根據指定的索引鍵選取器函式和索引鍵比較子,傳回泛型序列中的最小值。

MinBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,傳回泛型序列中的最小值。

Nodes<T>(IEnumerable<T>)

傳回來源集合中每個檔和專案之子節點的集合。

Normalize(String, NormalizationForm)

將字串正規化為指定的 Unicode 正規化形式。

Normalize(String)

將字串正規化為 Unicode 正規化形式 C。

OfType<TResult>(IEnumerable)

根據指定的型別篩選 IEnumerable 的專案。

Order<T>(IEnumerable<T>, IComparer<T>)

以遞增順序排序序列的專案。

Order<T>(IEnumerable<T>)

以遞增順序排序序列的專案。

OrderBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

使用指定的比較子,以遞增順序排序序列的專案。

OrderBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據索引鍵,以遞增順序排序序列的專案。

OrderByDescending<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

使用指定的比較子,以遞減順序排序序列的專案。

OrderByDescending<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據索引鍵,以遞減順序排序序列的專案。

OrderDescending<T>(IEnumerable<T>, IComparer<T>)

依遞減順序排序序列的專案。

OrderDescending<T>(IEnumerable<T>)

依遞減順序排序序列的專案。

Prepend<TSource>(IEnumerable<TSource>, TSource)

將值加入序列的開頭。

Remove<T>(IEnumerable<T>)

從來源集合的父節點中移除每個節點。

Reverse<TSource>(IEnumerable<TSource>)

反轉序列中項目的順序。

RightJoin<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,TInner,TResult>, IEqualityComparer<TKey>)

根據匹配的鍵數關聯兩個序列的元素。 指定的 IEqualityComparer<T> 可用來比較索引鍵。

RightJoin<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,TInner,TResult>)

根據匹配的鍵數關聯兩個序列的元素。 默認相等比較子可用來比較索引鍵。

Select<TSource,TResult>(IEnumerable<TSource>, Func<TSource,Int32,TResult>)

藉由合併元素的索引,將序列的每個專案投影成新的表單。

Select<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

將序列的每個專案投影成新的表單。

SelectMany<TSource,TCollection,TResult>(IEnumerable<TSource>, Func<TSource,IEnumerable<TCollection>>, Func<TSource,TCollection,TResult>)

將序列的每個專案投影到 IEnumerable<T>,將產生的序列扁平化成一個序列,並在其中的每個元素上叫用結果選取器函式。

SelectMany<TSource,TCollection,TResult>(IEnumerable<TSource>, Func<TSource,Int32,IEnumerable<TCollection>>, Func<TSource,TCollection,TResult>)

將序列的每個專案投影到 IEnumerable<T>,將產生的序列扁平化成一個序列,並在其中的每個元素上叫用結果選取器函式。 每個來源專案的索引會用於該專案的中繼投影形式。

SelectMany<TSource,TResult>(IEnumerable<TSource>, Func<TSource,IEnumerable<TResult>>)

將序列的每個專案投影到 IEnumerable<T>,並將產生的序列扁平化成一個序列。

SelectMany<TSource,TResult>(IEnumerable<TSource>, Func<TSource,Int32,IEnumerable<TResult>>)

將序列的每個專案投影至 IEnumerable<T>,並將產生的序列扁平化成一個序列。 每個來源專案的索引會以該專案的投影形式使用。

SequenceEqual<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T>,判斷兩個序列是否相等。

SequenceEqual<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

判斷兩個序列是否相等,方法是使用其型別的默認相等比較子來比較專案。

Shuffle<TSource>(IEnumerable<TSource>)

洗牌序列中元素的順序。

Single<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回序列中唯一符合指定條件的專案,如果有多個這類專案存在,則會擲回例外狀況。

Single<TSource>(IEnumerable<TSource>)

傳回序列的唯一專案,如果序列中沒有一個專案,則會擲回例外狀況。

SingleOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>, TSource)

傳回序列中唯一符合指定條件的專案,如果沒有這類專案,則傳回指定的預設值;如果一個以上的專案符合條件,這個方法會擲回例外狀況。

SingleOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回序列中唯一符合指定條件的專案,如果沒有這類專案,則傳回預設值;如果一個以上的專案符合條件,這個方法會擲回例外狀況。

SingleOrDefault<TSource>(IEnumerable<TSource>, TSource)

傳回序列的唯一專案,如果序列是空的,則傳回指定的預設值;如果序列中有多個項目,這個方法會擲回例外狀況。

SingleOrDefault<TSource>(IEnumerable<TSource>)

傳回序列的唯一專案;如果序列是空的,則傳回預設值;如果序列中有多個項目,這個方法會擲回例外狀況。

Skip<TSource>(IEnumerable<TSource>, Int32)

略過序列中指定數目的專案,然後傳回其餘專案。

SkipLast<TSource>(IEnumerable<TSource>, Int32)

回傳一個新的可枚舉集合,包含 的 source 元素,且刪除原始集合的最後元素 count

SkipWhile<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

只要指定的條件為 true,就會略過序列中的項目,然後傳回其餘元素。

SkipWhile<TSource>(IEnumerable<TSource>, Func<TSource,Int32,Boolean>)

只要指定的條件為 true,就會略過序列中的項目,然後傳回其餘元素。 元素的索引用於述詞函式的邏輯中。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

計算 Decimal 值序列的總和,這些值是在輸入序列的每個元素上叫用轉換函式所取得。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

計算 Double 值序列的總和,這些值是在輸入序列的每個元素上叫用轉換函式所取得。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

計算 Int32 值序列的總和,這些值是在輸入序列的每個元素上叫用轉換函式所取得。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

計算 Int64 值序列的總和,這些值是在輸入序列的每個元素上叫用轉換函式所取得。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

計算在輸入序列的每個元素上叫用轉換函式所取得之可為 Null Decimal 值的序列總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

計算在輸入序列的每個元素上叫用轉換函式所取得之可為 Null Double 值的序列總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

計算在輸入序列的每個元素上叫用轉換函式所取得之可為 Null Int32 值的序列總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

計算在輸入序列的每個元素上叫用轉換函式所取得之可為 Null Int64 值的序列總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

計算在輸入序列的每個元素上叫用轉換函式所取得之可為 Null Single 值的序列總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

計算 Single 值序列的總和,這些值是在輸入序列的每個元素上叫用轉換函式所取得。

Take<TSource>(IEnumerable<TSource>, Int32)

從序列開頭傳回指定的連續項目數目。

Take<TSource>(IEnumerable<TSource>, Range)

傳回序列中連續專案的指定範圍。

TakeLast<TSource>(IEnumerable<TSource>, Int32)

回傳一個新的可枚舉集合,包含 的count最後元素source

TakeWhile<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

只要指定的條件為 true,就會從序列傳回專案。

TakeWhile<TSource>(IEnumerable<TSource>, Func<TSource,Int32,Boolean>)

只要指定的條件為 true,就會從序列傳回專案。 元素的索引用於述詞函式的邏輯中。

ToArray<TSource>(IEnumerable<TSource>)

IEnumerable<T>建立陣列。

ToAsyncEnumerable<TSource>(IEnumerable<TSource>)

IEnumerable<T> 轉換成 IAsyncEnumerable<T>

ToDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式、比較子和元素選取器函式,從 Dictionary<TKey,TValue> 建立 IEnumerable<T>

ToDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

根據指定的索引鍵選取器和項目選取器函式,從 Dictionary<TKey,TValue> 建立 IEnumerable<T>

ToDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式和索引鍵比較子,從 Dictionary<TKey,TValue> 建立 IEnumerable<T>

ToDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,從 Dictionary<TKey,TValue> 建立 IEnumerable<T>

ToFrozenDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器和項目選取器函式,從 FrozenDictionary<TKey,TValue> 建立 IEnumerable<T>

ToFrozenDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的鍵選擇函式從 FrozenDictionary<TKey,TValue> a 建立 。IEnumerable<T>

ToFrozenSet<T>(IEnumerable<T>, IEqualityComparer<T>)

建立 FrozenSet<T> 一個符合指定值的 。

ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

使用 HashSet<T> 比較索引鍵,從 IEnumerable<T> 建立 comparer

ToHashSet<TSource>(IEnumerable<TSource>)

HashSet<T>建立 IEnumerable<T>

ToImmutableArray<TSource>(IEnumerable<TSource>)

從指定的集合建立不可變的陣列。

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

列舉和轉換序列,並使用指定的索引鍵和值比較子產生其內容的不可變字典。

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>)

列舉和轉換序列,並使用指定的索引鍵比較子產生其內容的不可變字典。

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

列舉和轉換序列,併產生其內容的不可變字典。

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據序列的一些轉換,建構不可變的字典。

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

從現有的專案集合建構不可變的字典,將轉換函式套用至來源索引鍵。

ToImmutableHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

列舉序列、產生其內容的不可變哈希集,並使用集合類型的指定相等比較子。

ToImmutableHashSet<TSource>(IEnumerable<TSource>)

列舉序列,併產生其內容的不可變哈希集。

ToImmutableList<TSource>(IEnumerable<TSource>)

列舉序列,併產生其內容的不可變清單。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>, IEqualityComparer<TValue>)

列舉和轉換序列,並使用指定的索引鍵和值比較子產生其內容的不可變排序字典。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>)

列舉和轉換序列,並使用指定的索引鍵比較子產生其內容的不可變排序字典。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

列舉和轉換序列,併產生其內容的不可變排序字典。

ToImmutableSortedSet<TSource>(IEnumerable<TSource>, IComparer<TSource>)

列舉序列、產生其內容的不可變排序集,並使用指定的比較子。

ToImmutableSortedSet<TSource>(IEnumerable<TSource>)

列舉序列,併產生其內容的不可變排序集。

ToList<TSource>(IEnumerable<TSource>)

List<T>建立 IEnumerable<T>

ToLookup<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式、比較子和元素選取器函式,從 Lookup<TKey,TElement> 建立 IEnumerable<T>

ToLookup<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

根據指定的索引鍵選取器和項目選取器函式,從 Lookup<TKey,TElement> 建立 IEnumerable<T>

ToLookup<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式和索引鍵比較子,從 Lookup<TKey,TElement> 建立 IEnumerable<T>

ToLookup<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,從 Lookup<TKey,TElement> 建立 IEnumerable<T>

TryGetNonEnumeratedCount<TSource>(IEnumerable<TSource>, Int32)

嘗試判斷序列中的元素數目,而不強制列舉。

Union<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T>產生兩個序列的集合聯集。

Union<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

使用預設相等比較子產生兩個序列的集合聯集。

UnionBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式,產生兩個序列的集合聯集。

UnionBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,產生兩個序列的集合聯集。

Where<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

根據述詞篩選值序列。

Where<TSource>(IEnumerable<TSource>, Func<TSource,Int32,Boolean>)

根據述詞篩選值序列。 每個元素的索引都會用於述詞函式的邏輯中。

Zip<TFirst,TSecond,TResult>(IEnumerable<TFirst>, IEnumerable<TSecond>, Func<TFirst,TSecond,TResult>)

將指定的函式套用至兩個序列的對應專案,產生結果序列。

Zip<TFirst,TSecond,TThird>(IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>)

產生具有來自三個指定序列之元素的 Tuple 序列。

Zip<TFirst,TSecond>(IEnumerable<TFirst>, IEnumerable<TSecond>)

產生具有來自兩個指定序列之元素的 Tuple 序列。

適用於

執行緒安全性

此類型是安全線程。

另請參閱