String 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
以 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] | |
| 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) | |
| CompareOrdinal(String, String) | |
| CompareTo(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) |
已淘汰.
|
| 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() | |
| 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) |
表示指定的字串 |
| IsNullOrWhiteSpace(String) |
表示指定字串 |
| Join(Char, Object[]) |
使用每個成員之間的指定分隔符,串連 物件陣列的字串表示。 |
| Join(Char, ReadOnlySpan<Object>) |
使用每個成員之間的指定分隔符,串連物件範圍的字串表示。 |
| Join(Char, ReadOnlySpan<String>) |
使用每個成員之間的指定分隔符,串連字串範圍。 |
| Join(Char, String[], Int32, Int32) |
串接一組字串,使用每個成員間指定的分隔符,從位於該 |
| 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) |
將目前字串中所有換行序列替換為 |
| 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) |
判斷兩個指定字串的值是否不同。 |
明確介面實作
擴充方法
適用於
執行緒安全性
此類型是安全線程。