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 ^>, 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, 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>, 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>
[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>
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 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)
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, 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 備註

建構函式

String(Char*)

String 類別的新執行個體初始化為 Unicode 字元陣列的指定指標所指示的值。

String(Char*, Int32, Int32)

String 類別的新執行個體初始化為 Unicode 字元陣列、在陣列內起始字元的位置以及長度等等的指定指標所指示的值。

String(Char, Int32)

String 類別的新執行個體初始化為由重複指定次數的指定 Unicode 字元所指示的值。

String(Char[])

String 類別新執行個體初始化為所指定字元陣列中指出的 Unicode 字元。

String(Char[], Int32, Int32)

String 類別的新執行個體初始化為 Unicode 字元陣列、在陣列內起始字元的位置和長度等等所指示的值。

String(ReadOnlySpan<Char>)

String 類別新執行個體初始化為所指定唯讀範圍中指出的 Unicode 字元。

String(SByte*)

String 類別的新執行個體初始化為 8 位元帶正負號整數 (Signed Integer) 陣列的指標所指示的值。

String(SByte*, Int32, Int32)

String 類別的新執行個體初始化為 8 位元帶正負號整數的陣列、在該陣列內開始位置和長度的指定指標所指示的值。

String(SByte*, Int32, Int32, Encoding)

String 類別的新執行個體初始化為 8 位元帶正負號整數的陣列、在該陣列內開始位置、長度和 Encoding 物件的指定指標所指示的值。

欄位

Empty

表示空字串。 此欄位為唯讀。

屬性

Chars[Int32]

取得目前 Char 物件中指定位置的 String 物件。

Length

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

方法

Clone()

傳回對 String這個執行個體的參考。

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

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

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

比較兩個指定之 String 物件的子字串,忽略或區分兩者的大小寫,並傳回一個整數,表示兩者在排序順序中的相對位置。

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

比較兩個指定之 String 物件的子字串,忽略或區分兩者的大小寫,並使用文化特性資訊來影響比較,然後傳回一個整數,表示兩者在排序順序中的相對位置。

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

比較兩個指定的 String 物件的子字串,使用指定的比較選項及特定文化特性資訊影響比較,然後傳回整數,這個整數表示這兩個子字串在排序次序中彼此的關聯性。

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

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

Compare(String, String)

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

Compare(String, String, Boolean)

比較兩個指定的 String 物件,忽略或區分兩者的大小寫,並傳回一個整數,表示兩者在排序順序中的相對位置。

Compare(String, String, Boolean, CultureInfo)

比較兩個指定的 String 物件,忽略或區分兩者的大小寫,並使用特定文化特性資訊來影響比較,然後傳回一個整數,表示兩者在排序順序中的相對位置。

Compare(String, String, CultureInfo, CompareOptions)

比較兩個指定的 String 物件,使用指定的比較選項及特定文化特性資訊影響比較,然後傳回整數,這個整數表示這兩個字串在排序次序中彼此的關聯性。

Compare(String, String, StringComparison)

使用指定的規則比較兩個指定的 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)

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

Concat(Object, Object)

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

Concat(Object, Object, Object)

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

Concat(Object, Object, Object, Object)

串連四個指定的物件之字串表示和選擇性變數長度參數清單中所指定的任何物件。

Concat(Object[])

串連指定之 Object 陣列中項目的字串表示法。

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

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

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

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

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

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

Concat(String, String)

串連 String 的兩個指定執行個體。

Concat(String, String, String)

串連 String 的三個指定執行個體。

Concat(String, String, String, String)

串連 String 的四個指定執行個體。

Concat(String[])

串連指定 String 陣列中的項目。

Concat<T>(IEnumerable<T>)

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

Contains(Char)

傳回值,這個值表示指定的字元是否會出現在這個字串內。

Contains(Char, StringComparison)

使用指定的比較規則傳回值,這個值表示指定的字元是否會出現在這個字串內。

Contains(String)

傳回值,這個值表示指定的子字串是否會出現在這個字串內。

Contains(String, StringComparison)

使用指定的比較規則傳回值,這個值表示指定的字串是否會出現在這個字串內。

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)

判斷這個字串執行個體的結尾是否符合所指定字元。

EndsWith(String)

判斷這個字串執行個體的結尾是否符合指定的字串。

EndsWith(String, Boolean, CultureInfo)

判斷當使用指定之文化特性進行比較時,這個字串執行個體的結尾是否符合指定的字串。

EndsWith(String, StringComparison)

判斷當使用指定的比較選項進行比較時,這個字串執行個體的結尾是否符合指定的字串。

EnumerateRunes()

從這個字串傳回 Rune 的列舉。

Equals(Object)

判斷這個執行個體和指定的物件 (同時還必須是 String 物件) 是否具有相同的值。

Equals(String)

判斷這個執行個體和另一個指定的 String 物件是否具有相同的值。

Equals(String, String)

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

Equals(String, String, StringComparison)

判斷兩個指定的 String 物件是否具有相同的值。 參數可指定用於比較的文化特性、大小寫及排序規則。

Equals(String, StringComparison)

判斷這個字串和指定的 String 物件是否具有相同的值。 參數可指定用於比較的文化特性、大小寫及排序規則。

Format(IFormatProvider, CompositeFormat, Object[])

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

Format(IFormatProvider, CompositeFormat, ReadOnlySpan<Object>)

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

Format(IFormatProvider, String, Object)

以對應物件的字串表示,取代指定之字串中的一或多個格式項目。 參數提供特定文化特性格式資訊。

Format(IFormatProvider, String, Object, Object)

以兩個指定物件的字串表示,取代字串中的格式項目。 參數提供特定文化特性格式資訊。

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

以三個指定物件的字串表示,取代字串中的格式項目。 參數提供特定文化特性格式資訊。

Format(IFormatProvider, String, Object[])

以指定陣列中對應物件的字串表示,取代字串中的格式項目。 參數提供特定文化特性格式資訊。

Format(String, Object)

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

Format(String, Object, Object)

以兩個指定物件的字串表示,取代字串中的格式項目。

Format(String, Object, Object, Object)

以三個指定物件的字串表示,取代字串中的格式項目。

Format(String, 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>)

傳回所提供唯讀字元範圍的雜湊碼。

GetHashCode(ReadOnlySpan<Char>, StringComparison)

使用指定的規則,傳回所提供唯讀字元範圍的雜湊碼。

GetHashCode(StringComparison)

使用指定規則傳回這個字串的雜湊碼。

GetPinnableReference()

傳回位於索引零的字串元素參考。

這個方法旨在支援 .NET 編譯程式,而不是由使用者程式代碼呼叫。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
GetTypeCode()

針對 String 類別傳回 TypeCode

IndexOf(Char)

報告這個字串中指定之 Unicode 字元第一次出現時的所在索引 (以零為起始)。

IndexOf(Char, Int32)

報告這個字串中指定之 Unicode 字元第一次出現時的所在索引 (以零為起始)。 搜尋從指定的字元位置開始。

IndexOf(Char, Int32, Int32)

報告這個執行個體中指定之字元第一次出現時的所在索引 (以零為起始)。 搜尋從指定的字元位置開始,並檢視指定數目的字元位置。

IndexOf(Char, StringComparison)

報告這個字串中指定之 Unicode 字元第一次出現時的所在索引 (以零為起始)。 參數會指定要用於指定字元的搜尋類型。

IndexOf(String)

回報這個執行個體中指定之字串第一次出現時的所在索引 (以零為起始)。

IndexOf(String, Int32)

回報這個執行個體中指定之字串第一次出現時的所在索引 (以零為起始)。 搜尋從指定的字元位置開始。

IndexOf(String, Int32, Int32)

回報這個執行個體中指定之字串第一次出現時的所在索引 (以零為起始)。 搜尋從指定的字元位置開始,並檢視指定數目的字元位置。

IndexOf(String, Int32, Int32, StringComparison)

報告目前 String 物件中指定之字串第一次出現時的所在索引 (以零為起始)。 參數會指定目前字串中的開始搜尋位置、目前字串中要搜尋的字元數目,以及要用於指定字串的搜尋類型。

IndexOf(String, Int32, StringComparison)

報告目前 String 物件中指定之字串第一次出現時的所在索引 (以零為起始)。 參數會指定目前字串中的開始搜尋位置和要用於指定字串的搜尋類型。

IndexOf(String, StringComparison)

報告目前 String 物件中指定之字串第一次出現時的所在索引 (以零為起始)。 參數會指定要用於指定字串的搜尋類型。

IndexOfAny(Char[])

報告指定的 Unicode 字元陣列中,任何字元在這個執行個體中第一次出現時的所在索引 (以零為起始)。

IndexOfAny(Char[], Int32)

報告指定的 Unicode 字元陣列中,任何字元在這個執行個體中第一次出現時的所在索引 (以零為起始)。 搜尋從指定的字元位置開始。

IndexOfAny(Char[], Int32, Int32)

報告指定的 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, String[])

在每個成員間使用所指定分隔符號來串連字串陣列。

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

在每個成員間使用所指定分隔符號來串連字串陣列,從位在 startIndex 位置 value 中的元素開始,最多串連 count 個元素。

Join(String, IEnumerable<String>)

串連類型 IEnumerable<T> 之已建構的 String 集合的成員,並在每個成員之間使用指定的分隔符號。

Join(String, Object[])

串連物件陣列的項目,並在每個項目之間使用指定的分隔符號。

Join(String, String[])

串連字串陣列的所有項目,並在每個項目之間使用指定的分隔符號。

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

串連字串陣列的指定項目,並在每個項目之間使用指定的分隔符號。

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

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

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

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

LastIndexOf(Char)

報告這個執行個體中指定之 Unicode 字元最後一次出現時的所在索引 (以零為起始)。

LastIndexOf(Char, Int32)

報告這個執行個體中指定之 Unicode 字元最後一次出現時的所在索引 (以零為起始)。 搜尋會從指定的字元位置開始,然後反向朝字串的開頭進行。

LastIndexOf(Char, Int32, Int32)

報告這個執行個體的子字串中,指定的 Unicode 字元最後一次出現時的所在索引 (以零為起始)。 搜尋會從指定的字元位置開始,然後反向朝字串開頭指定數目的字元位置進行。

LastIndexOf(String)

回報這個執行個體中指定之字串最後一次出現時的所在索引 (以零為起始)。

LastIndexOf(String, Int32)

回報這個執行個體中指定之字串最後一次出現時的所在索引 (以零為起始)。 搜尋會從指定的字元位置開始,然後反向朝字串的開頭進行。

LastIndexOf(String, Int32, Int32)

回報這個執行個體中指定之字串最後一次出現時的所在索引 (以零為起始)。 搜尋會從指定的字元位置開始,然後反向朝字串開頭指定數目的字元位置進行。

LastIndexOf(String, Int32, Int32, StringComparison)

回報這個執行個體中指定之字串最後一次出現時的所在索引 (以零為起始)。 搜尋會從指定的字元位置開始,然後反向朝字串開頭指定數目的字元位置進行。 參數會指定搜尋指定字串時要執行的比較類型。

LastIndexOf(String, Int32, StringComparison)

報告目前 String 物件中指定之字串最後一次出現時的所在索引 (以零為起始)。 搜尋會從指定的字元位置開始,然後反向朝字串的開頭進行。 參數會指定搜尋指定字串時要執行的比較類型。

LastIndexOf(String, StringComparison)

報告目前 String 物件中指定之字串最後一次出現時的所在索引 (以零為起始)。 參數會指定要用於指定字串的搜尋類型。

LastIndexOfAny(Char[])

報告 Unicode 陣列中的一或多個指定的字元,在這個執行個體中最後一次出現時的所在索引 (以零為起始)。

LastIndexOfAny(Char[], Int32)

報告 Unicode 陣列中的一或多個指定的字元,在這個執行個體中最後一次出現時的所在索引 (以零為起始)。 搜尋會從指定的字元位置開始,然後反向朝字串的開頭進行。

LastIndexOfAny(Char[], Int32, Int32)

報告 Unicode 陣列中的一或多個指定的字元,在這個執行個體中最後一次出現時的所在索引 (以零為起始)。 搜尋會從指定的字元位置開始,然後反向朝字串開頭指定數目的字元位置進行。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
Normalize()

傳回新的字串,其文字值與這個字串相同,但是其二進位表示為 Unicode 正規化格式 C。

Normalize(NormalizationForm)

傳回新的字串,其文字值與這個字串相同,但是其二進位表示為特定的 Unicode 正規化格式。

PadLeft(Int32)

傳回新字串,此字串會以空格填補左側至指定的總長度,靠右對齊這個執行個體中的字元。

PadLeft(Int32, Char)

傳回新字串,此字串會以指定的 Unicode 字元填補左側至指定的總長度,靠右對齊這個執行個體中的字元。

PadRight(Int32)

傳回新字串,此字串會以空格填補右側至指定的總長度,靠左對齊這個字串中的字元。

PadRight(Int32, Char)

傳回新字串,此字串會以指定的 Unicode 字元填補右側至指定的總長度,靠左對齊這個字串中的字元。

Remove(Int32)

傳回新字串,其中已刪除目前執行個體中的所有字元 (從指定位置開始到最後一個位置為止)。

Remove(Int32, Int32)

傳回新字串,其中已刪除在目前執行個體中指定位置開始之指定數目的字元。

Replace(Char, Char)

傳回新字串,其中這個執行個體中所有出現的指定 Unicode 字元都取代成其他指定的 Unicode 字元。

Replace(String, String)

傳回新字串,其中目前執行個體中所有出現的指定字串,都取代成其他指定的字串。

Replace(String, String, Boolean, CultureInfo)

傳回新字串,使用提供的文化特性並區分大小寫,將目前執行個體中出現的所有指定字串都替換成另一個指定字串。

Replace(String, String, StringComparison)

傳回新字串,使用提供的比較類型,將目前執行個體中出現的所有指定字串都替換成另一個指定字串。

ReplaceLineEndings()

以取代目前字串 NewLine中的所有換行符序列。

ReplaceLineEndings(String)

以取代目前字串 replacementText中的所有換行符序列。

Split(Char, Int32, StringSplitOptions)

根據指定的分隔字元和選擇性選項,將一個字串分割成最多數量的子字串。 根據提供的字元分隔符號,將一個字串分割成最多數量的子字串,並選擇性省略結果中的空白子字串。

Split(Char, StringSplitOptions)

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

Split(Char[])

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

Split(Char[], Int32)

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

Split(Char[], Int32, StringSplitOptions)

根據指定的分隔字元和選擇性選項,將一個字串分割成最多的子字串。

Split(Char[], StringSplitOptions)

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

Split(String, Int32, StringSplitOptions)

根據指定的分隔字串和選擇性選項,將一個字串分割成最多的子字串。

Split(String, StringSplitOptions)

根據所提供字串分隔符號將字串分割成子字串。

Split(String[], Int32, StringSplitOptions)

根據指定的分隔字串和選擇性選項,將一個字串分割成最多的子字串。

Split(String[], StringSplitOptions)

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

StartsWith(Char)

判斷此字串執行個體是否以指定的字元開頭。

StartsWith(String)

判斷這個字串執行個體的開頭是否符合指定的字串。

StartsWith(String, Boolean, CultureInfo)

判斷當使用指定之文化特性進行比較時,這個字串執行個體的開頭是否符合指定的字串。

StartsWith(String, StringComparison)

判斷當使用指定之比較選項進行比較時,這個字串執行個體的開頭是否符合指定的字串。

Substring(Int32)

從這個執行個體擷取子字串。 子字串會在指定的字元位置開始並繼續到字串的結尾。

Substring(Int32, 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[])

移除出現在目前字串開頭和結尾的所有陣列指定字元集。

TrimEnd()

移除目前字串結尾的所有空白字元。

TrimEnd(Char)

移除所有出現在目前字串結尾的字元。

TrimEnd(Char[])

移除出現在目前字串結尾的所有陣列指定字元集。

TrimStart()

移除目前字串開頭的所有空白字元。

TrimStart(Char)

移除出現在目前字串開頭的所有指定字元。

TrimStart(Char[])

移除出現在目前字串開頭的所有陣列指定字元集。

TryCopyTo(Span<Char>)

將這個字串的內容複製到目的地範圍。

運算子

Equality(String, String)

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

Implicit(String to ReadOnlySpan<Char>)

定義將指定字串隱含轉換成唯讀範圍的字元。

Inequality(String, String)

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

明確介面實作

IComparable.CompareTo(Object)

比較這個執行個體與指定的 Object,並且指出這個執行個體在排序次序中,位於所指定 Object 之前、之後或相同位置。

IConvertible.GetTypeCode()

針對 String 類別傳回 TypeCode

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 字碼單位表示文字。

擴充方法

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

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

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

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

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

使用 FrozenSet<T> 指定的值建立 。

ToImmutableArray<TSource>(IEnumerable<TSource>)

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

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

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

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

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

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,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>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

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

ToImmutableHashSet<TSource>(IEnumerable<TSource>)

列舉序列,並產生其內容之不可變雜湊集。

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

列舉序列、產生其內容之不可變雜湊集,且針對集合類型使用指定的相等比較子。

ToImmutableList<TSource>(IEnumerable<TSource>)

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

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,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>, IComparer<TKey>, IEqualityComparer<TValue>)

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

ToImmutableSortedSet<TSource>(IEnumerable<TSource>)

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

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

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

CopyToDataTable<T>(IEnumerable<T>)

根據輸入 DataTable 物件 (其中泛型參數 TDataRow) 傳回包含 IEnumerable<T> 物件複本的 DataRow

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

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRow

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

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRow

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

將累加函式套用到序列上。

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

將累加函式套用到序列上。 使用指定的初始值做為初始累加值。

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

將累加函式套用到序列上。 使用指定的值做為初始累加值,並使用指定的函式來選取結果值。

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

以一連串的 UTF-16 字碼單位表示文字。

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

以一連串的 UTF-16 字碼單位表示文字。

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

判斷序列的所有項目是否全都符合條件。

Any<TSource>(IEnumerable<TSource>)

判斷序列是否包含任何項目。

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

判斷序列的任何項目是否符合條件。

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

將值附加在序列結尾。

AsEnumerable<TSource>(IEnumerable<TSource>)

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

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)

使用預設的相等比較子 (Comparer) 來判斷序列是否包含指定的項目。

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

使用指定的 IEqualityComparer<T> 來判斷序列是否包含指定的項目。

Count<TSource>(IEnumerable<TSource>)

傳回序列中的項目數。

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

傳回數字,代表指定之序列中符合條件的項目數目。

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

以一連串的 UTF-16 字碼單位表示文字。

DefaultIfEmpty<TSource>(IEnumerable<TSource>)

傳回指定之序列的項目;如果序列是空的,則傳回單一集合中型別參數的預設值。

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

傳回指定之序列的項目;如果序列是空的,則傳回單一集合中型別參數的預設值。

Distinct<TSource>(IEnumerable<TSource>)

使用預設的相等比較子來比較值,以便從序列傳回獨特的項目。

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

使用指定的 IEqualityComparer<T> 來比較值,以便從序列傳回獨特的項目。

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

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

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

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

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

傳回位於序列中指定索引處的項目。

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

傳回位於序列中指定索引處的項目。

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

傳回位於序列中指定索引處的元素;如果索引超出範圍,則傳回預設值。

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

傳回位於序列中指定索引處的元素;如果索引超出範圍,則傳回預設值。

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

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

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

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

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

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

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

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

First<TSource>(IEnumerable<TSource>)

傳回序列的第一個項目。

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

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

FirstOrDefault<TSource>(IEnumerable<TSource>)

傳回序列的第一個元素;如果序列中沒有包含任何元素,則傳回預設值。

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

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

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

傳回序列中符合條件的第一個元素;如果找不到這類元素,則傳回預設值。

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

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

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

依據指定的索引鍵選擇器函式來群組序列的項目。

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

依據指定的索引鍵選取器函式來群組序列的項目,並使用指定的比較子來比較索引鍵。

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

依據指定的索引鍵選取器函式來群組序列的項目,並使用指定的函式來投影每個群組的項目。

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

依據索引鍵選取器函式來群組序列中的項目。 索引鍵是使用比較子來進行比較,而每個群組的項目都是利用指定的函式進行投影。

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

依據指定的索引鍵選取器函式來群組序列的項目,並從每個群組及其索引鍵建立結果值。

GroupBy<TSource,TKey,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,IEnumerable<TSource>,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,TResult>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable<TElement>, TResult>, IEqualityComparer<TKey>)

依據指定的索引鍵選取器函式來群組序列的項目,並從每個群組及其索引鍵建立結果值。 索引鍵值是使用指定的比較子來進行比較,而每個群組的項目則都是利用指定的函式進行投影。

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

根據索引鍵相等與否,將兩個序列的項目相互關聯,並群組產生的結果。 預設的相等比較子是用於比較索引鍵。

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

根據索引鍵相等與否,將兩個序列的項目相互關聯,並群組產生的結果。 指定的 IEqualityComparer<T> 是用於比較索引鍵。

Index<TSource>(IEnumerable<TSource>)

以一連串的 UTF-16 字碼單位表示文字。

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

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

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

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

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

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

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

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

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

根據相符索引鍵,將兩個序列的項目相互關聯。 預設的相等比較子是用於比較索引鍵。

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

根據相符索引鍵,將兩個序列的項目相互關聯。 指定的 IEqualityComparer<T> 是用於比較索引鍵。

Last<TSource>(IEnumerable<TSource>)

傳回序列的最後一個項目。

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

傳回序列中符合指定之條件的最後一個元素。

LastOrDefault<TSource>(IEnumerable<TSource>)

傳回序列的最後一個元素;如果序列中沒有包含任何元素,則傳回預設值。

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

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

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

傳回序列中符合條件的最後一個元素;如果找不到這類元素,則傳回預設值。

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

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

LongCount<TSource>(IEnumerable<TSource>)

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

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

傳回 Int64,其代表序列中符合條件的項目數目。

Max<TSource>(IEnumerable<TSource>)

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

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

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

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,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

在泛型序列的每個項目上叫用轉換函式,並傳回最大的結果值。

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

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

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

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

Min<TSource>(IEnumerable<TSource>)

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

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

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

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,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

在泛型序列的每個項目上叫用轉換函式,並傳回最小的結果值。

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

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

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

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

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。

Order<T>(IEnumerable<T>)

依遞增順序排序序列中的項目。

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

依遞增順序排序序列中的項目。

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

依據索引鍵,按遞增順序排序序列中的項目。

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

使用指定的比較子,依遞增順序排序序列中的項目。

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

依據索引鍵,按遞減順序排序序列中的項目。

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

使用指定的比較子,依遞減順序排序序列中的項目。

OrderDescending<T>(IEnumerable<T>)

依遞減順序排序序列中的項目。

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

依遞減順序排序序列中的項目。

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

將值新增至序列的開頭。

Reverse<TSource>(IEnumerable<TSource>)

反轉序列中項目的排序方向。

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

將序列的每個元素規劃成一個新的表單。

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

透過加入項目的索引,將序列的每個項目投影成新的表單。

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

將序列的每個項目都投影成 IEnumerable<T>,並將產生的序列簡化成單一序列。

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

將序列的每個項目都投影成 IEnumerable<T>,並將產生的序列簡化成單一序列。 各來源項目的索引是在該項目的投影表單中使用。

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>、將產生的序列簡化成單一序列,並對其中的每個項目叫用結果選取器函式。 各來源項目的索引是在該項目的中繼投影表單中使用。

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

使用項目之型別的預設相等比較子來比較項目,以判斷兩個序列是否相等。

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

使用指定的 IEqualityComparer<T> 來比較項目,以判斷兩個序列是否相等。

Single<TSource>(IEnumerable<TSource>)

傳回序列的唯一一個元素,如果序列中不是正好一個元素,則擲回例外狀況。

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

傳回序列中符合指定之條件的唯一一個元素,如果有一個以上這類元素,則擲回例外狀況。

SingleOrDefault<TSource>(IEnumerable<TSource>)

傳回序列的唯一一個項目,如果序列是空白,則為預設值,如果序列中有一個以上的項目,這個方法就會擲回例外狀況。

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

傳回序列的唯一元素,如果序列是空的,則傳回指定的預設值;如果序列中有一個以上的元素,這個方法就會擲回例外狀況。

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

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

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

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

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

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

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

傳回新的可列舉集合,其包含已省略來源集合最後 count 元素的所有 source 元素。

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)

傳回新的可列舉集合,其包含 source 的最後 count 元素。

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

只要指定的條件為 true,就會傳回序列中的項目。

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

只要指定的條件為 true,就會傳回序列中的項目。 項目的索引是用於述詞功能的邏輯中。

ToArray<TSource>(IEnumerable<TSource>)

IEnumerable<T> 建立陣列。

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

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

ToDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, 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,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

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

ToHashSet<TSource>(IEnumerable<TSource>)

IEnumerable<T> 建立 HashSet<T>

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

使用比較金鑰的 comparerIEnumerable<T> 建立 HashSet<T>

ToList<TSource>(IEnumerable<TSource>)

IEnumerable<T> 建立 List<T>

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

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

ToLookup<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, 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,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

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

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

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

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

使用預設相等比較值來比較值,以便產生兩個序列的集合等位。

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

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

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

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

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

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

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

根據述詞來篩選值序列。

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

根據述詞來篩選值序列。 述詞函式的邏輯中使用各項目的索引。

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

從兩個指定序列中的元素產生一系列元組。

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

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

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

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

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsParallel<TSource>(IEnumerable<TSource>)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

AsQueryable<TElement>(IEnumerable<TElement>)

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

AsMemory(String)

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

AsMemory(String, Index)

在起始於指定索引的目標字串部分上建立新 ReadOnlyMemory<Char>

AsMemory(String, Int32)

在起始於指定字元位置的目標字串部分上建立新 ReadOnlyMemory<Char>

AsMemory(String, Int32, Int32)

在起始於指定位置且具有一個長度的目標字串部分上建立新 ReadOnlyMemory<Char>

AsMemory(String, Range)

在指定的目標字串範圍上建立新 ReadOnlyMemory<Char>

AsSpan(String)

在字串上建立新唯讀範圍。

AsSpan(String, Index)

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

AsSpan(String, Int32)

在起始於指定位置到字串結尾的目標字串部分上建立新唯讀範圍。

AsSpan(String, Int32, Int32)

在起始於指定位置且具有指定字元數的目標字串部分上建立新唯讀範圍。

AsSpan(String, Range)

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

IsNormalized(String)

指出指定的字串是否為 Unicode 正規化格式 C。

IsNormalized(String, NormalizationForm)

指出字串是否為指定的 Unicode 正規化格式。

Normalize(String)

將字串標準化為 Unicode 正規化格式 C。

Normalize(String, NormalizationForm)

將字串標準化為指定的 Unicode 正規化格式。

Ancestors<T>(IEnumerable<T>)

傳回包含來源集合中每個節點祖系的項目集合。

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

傳回包含來源集合中每個節點祖系的已篩選項目集合。 集合中只會包含具有相符之 XName 的項目。

DescendantNodes<T>(IEnumerable<T>)

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

Descendants<T>(IEnumerable<T>)

傳回包含來源集合中每個項目和文件之子代項目的項目集合。

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

傳回已篩選的項目集合,其中包含來源集合中每個項目和文件的子代項目。 集合中只會包含具有相符之 XName 的項目。

Elements<T>(IEnumerable<T>)

傳回來源集合中每個項目和文件的子項目集合。

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

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

InDocumentOrder<T>(IEnumerable<T>)

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

Nodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目的子節點集合。

Remove<T>(IEnumerable<T>)

在來源集合中,從每一個節點的父節點移除這些節點。

適用於

執行緒安全性

此型別具備執行緒安全。

另請參閱