MemoryExtensions.TrimEnd 方法

定義

多載

TrimEnd(ReadOnlySpan<Char>, Char)

從唯讀範圍中移除所有尾端指定字元項目。

TrimEnd(Span<Char>)

從字元範圍中移除所有尾端空白字元。

TrimEnd(ReadOnlySpan<Char>, ReadOnlySpan<Char>)

從唯讀字元範圍中移除唯讀範圍中指定的所有尾端字元集項目。

TrimEnd(ReadOnlyMemory<Char>)

從唯讀字元記憶體區域中移除所有尾端空白字元。

TrimEnd(Memory<Char>)

從字元記憶體區域中移除所有尾端空白字元。

TrimEnd(ReadOnlySpan<Char>)

從唯讀字元範圍中移除所有尾端空白字元。

TrimEnd<T>(Span<T>, T)

從範圍中移除所有尾端指定元素項目。

TrimEnd<T>(Span<T>, ReadOnlySpan<T>)

從範圍中移除唯讀範圍中指定的所有尾端元素集項目。

TrimEnd<T>(ReadOnlySpan<T>, T)

從唯讀範圍中移除所有尾端指定元素項目。

TrimEnd<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

從唯讀範圍中移除唯讀範圍中指定的所有尾端元素集項目。

TrimEnd<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>)

從唯讀記憶體區域中移除唯讀範圍中指定的所有尾端元素集項目。

TrimEnd<T>(Memory<T>, T)

從字元記憶體區域中移除所有尾端指定元素項目。

TrimEnd<T>(Memory<T>, ReadOnlySpan<T>)

從記憶體區域中移除唯讀範圍中指定的所有尾端元素集項目。

TrimEnd<T>(ReadOnlyMemory<T>, T)

從唯讀記憶體區域中移除所有尾端指定元素項目。

TrimEnd(ReadOnlySpan<Char>, Char)

從唯讀範圍中移除所有尾端指定字元項目。

public:
[System::Runtime::CompilerServices::Extension]
 static ReadOnlySpan<char> TrimEnd(ReadOnlySpan<char> span, char trimChar);
public static ReadOnlySpan<char> TrimEnd (this ReadOnlySpan<char> span, char trimChar);
static member TrimEnd : ReadOnlySpan<char> * char -> ReadOnlySpan<char>
<Extension()>
Public Function TrimEnd (span As ReadOnlySpan(Of Char), trimChar As Char) As ReadOnlySpan(Of Char)

參數

span
ReadOnlySpan<Char>

要從中移除字元的來源範圍。

trimChar
Char

要尋找並移除的指定字元。

傳回

ReadOnlySpan<Char>

修剪的唯讀字元範圍。

適用於

TrimEnd(Span<Char>)

從字元範圍中移除所有尾端空白字元。

public:
[System::Runtime::CompilerServices::Extension]
 static Span<char> TrimEnd(Span<char> span);
public static Span<char> TrimEnd (this Span<char> span);
static member TrimEnd : Span<char> -> Span<char>
<Extension()>
Public Function TrimEnd (span As Span(Of Char)) As Span(Of Char)

參數

span
Span<Char>

要從中移除字元的來源範圍。

傳回

Span<Char>

修剪的字元範圍。

適用於

TrimEnd(ReadOnlySpan<Char>, ReadOnlySpan<Char>)

從唯讀字元範圍中移除唯讀範圍中指定的所有尾端字元集項目。

public:
[System::Runtime::CompilerServices::Extension]
 static ReadOnlySpan<char> TrimEnd(ReadOnlySpan<char> span, ReadOnlySpan<char> trimChars);
public static ReadOnlySpan<char> TrimEnd (this ReadOnlySpan<char> span, ReadOnlySpan<char> trimChars);
static member TrimEnd : ReadOnlySpan<char> * ReadOnlySpan<char> -> ReadOnlySpan<char>
<Extension()>
Public Function TrimEnd (span As ReadOnlySpan(Of Char), trimChars As ReadOnlySpan(Of Char)) As ReadOnlySpan(Of Char)

參數

span
ReadOnlySpan<Char>

要從中移除字元的來源範圍。

trimChars
ReadOnlySpan<Char>

範圍,其中包含要移除的字元集。

傳回

ReadOnlySpan<Char>

修剪的唯讀字元範圍。

備註

如果 trimChars 是空的,則會改為移除空白字元。

適用於

TrimEnd(ReadOnlyMemory<Char>)

從唯讀字元記憶體區域中移除所有尾端空白字元。

public:
[System::Runtime::CompilerServices::Extension]
 static ReadOnlyMemory<char> TrimEnd(ReadOnlyMemory<char> memory);
public static ReadOnlyMemory<char> TrimEnd (this ReadOnlyMemory<char> memory);
static member TrimEnd : ReadOnlyMemory<char> -> ReadOnlyMemory<char>
<Extension()>
Public Function TrimEnd (memory As ReadOnlyMemory(Of Char)) As ReadOnlyMemory(Of Char)

參數

memory
ReadOnlyMemory<Char>

要從中移除字元的來源記憶體。

傳回

ReadOnlyMemory<Char>

修剪的唯讀字元範圍。

適用於

TrimEnd(Memory<Char>)

從字元記憶體區域中移除所有尾端空白字元。

public:
[System::Runtime::CompilerServices::Extension]
 static Memory<char> TrimEnd(Memory<char> memory);
public static Memory<char> TrimEnd (this Memory<char> memory);
static member TrimEnd : Memory<char> -> Memory<char>
<Extension()>
Public Function TrimEnd (memory As Memory(Of Char)) As Memory(Of Char)

參數

memory
Memory<Char>

要從中移除字元的來源記憶體。

傳回

Memory<Char>

修剪的字元記憶體區域。

適用於

TrimEnd(ReadOnlySpan<Char>)

從唯讀字元範圍中移除所有尾端空白字元。

public:
[System::Runtime::CompilerServices::Extension]
 static ReadOnlySpan<char> TrimEnd(ReadOnlySpan<char> span);
public static ReadOnlySpan<char> TrimEnd (this ReadOnlySpan<char> span);
static member TrimEnd : ReadOnlySpan<char> -> ReadOnlySpan<char>
<Extension()>
Public Function TrimEnd (span As ReadOnlySpan(Of Char)) As ReadOnlySpan(Of Char)

參數

span
ReadOnlySpan<Char>

要從中移除字元的來源範圍。

傳回

ReadOnlySpan<Char>

修剪的唯讀字元範圍。

適用於

TrimEnd<T>(Span<T>, T)

從範圍中移除所有尾端指定元素項目。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static Span<T> TrimEnd(Span<T> span, T trimElement);
public static Span<T> TrimEnd<T> (this Span<T> span, T trimElement) where T : IEquatable<T>;
static member TrimEnd : Span<'T (requires 'T :> IEquatable<'T>)> * 'T -> Span<'T (requires 'T :> IEquatable<'T>)> (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function TrimEnd(Of T As IEquatable(Of T)) (span As Span(Of T), trimElement As T) As Span(Of T)

類型參數

T

範圍中專案的型別。

參數

span
Span<T>

要從中移除元素的來源範圍。

trimElement
T

要尋找並移除的指定元素。

傳回

Span<T>

修剪的範圍。

適用於

TrimEnd<T>(Span<T>, ReadOnlySpan<T>)

從範圍中移除唯讀範圍中指定的所有尾端元素集項目。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static Span<T> TrimEnd(Span<T> span, ReadOnlySpan<T> trimElements);
public static Span<T> TrimEnd<T> (this Span<T> span, ReadOnlySpan<T> trimElements) where T : IEquatable<T>;
static member TrimEnd : Span<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> Span<'T (requires 'T :> IEquatable<'T>)> (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function TrimEnd(Of T As IEquatable(Of T)) (span As Span(Of T), trimElements As ReadOnlySpan(Of T)) As Span(Of T)

類型參數

T

範圍中專案的型別。

參數

span
Span<T>

要從中移除元素的來源範圍。

trimElements
ReadOnlySpan<T>

範圍,其中包含要移除的元素集。

傳回

Span<T>

修剪的範圍。

備註

如果 trimElements 是空的,則會傳回未變更範圍。

適用於

TrimEnd<T>(ReadOnlySpan<T>, T)

從唯讀範圍中移除所有尾端指定元素項目。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static ReadOnlySpan<T> TrimEnd(ReadOnlySpan<T> span, T trimElement);
public static ReadOnlySpan<T> TrimEnd<T> (this ReadOnlySpan<T> span, T trimElement) where T : IEquatable<T>;
static member TrimEnd : ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> * 'T -> ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function TrimEnd(Of T As IEquatable(Of T)) (span As ReadOnlySpan(Of T), trimElement As T) As ReadOnlySpan(Of T)

類型參數

T

唯讀範圍中的專案類型。

參數

span
ReadOnlySpan<T>

要從中移除元素的來源範圍。

trimElement
T

要尋找並移除的指定元素。

傳回

ReadOnlySpan<T>

修剪的唯讀範圍。

適用於

TrimEnd<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

從唯讀範圍中移除唯讀範圍中指定的所有尾端元素集項目。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static ReadOnlySpan<T> TrimEnd(ReadOnlySpan<T> span, ReadOnlySpan<T> trimElements);
public static ReadOnlySpan<T> TrimEnd<T> (this ReadOnlySpan<T> span, ReadOnlySpan<T> trimElements) where T : IEquatable<T>;
static member TrimEnd : ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function TrimEnd(Of T As IEquatable(Of T)) (span As ReadOnlySpan(Of T), trimElements As ReadOnlySpan(Of T)) As ReadOnlySpan(Of T)

類型參數

T

唯讀範圍中的專案類型。

參數

span
ReadOnlySpan<T>

要從中移除元素的來源範圍。

trimElements
ReadOnlySpan<T>

範圍,其中包含要移除的元素集。

傳回

ReadOnlySpan<T>

修剪的唯讀範圍。

備註

如果 trimElements 是空的,則會傳回未變更範圍。

適用於

TrimEnd<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>)

從唯讀記憶體區域中移除唯讀範圍中指定的所有尾端元素集項目。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static ReadOnlyMemory<T> TrimEnd(ReadOnlyMemory<T> memory, ReadOnlySpan<T> trimElements);
public static ReadOnlyMemory<T> TrimEnd<T> (this ReadOnlyMemory<T> memory, ReadOnlySpan<T> trimElements) where T : IEquatable<T>;
static member TrimEnd : ReadOnlyMemory<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> ReadOnlyMemory<'T (requires 'T :> IEquatable<'T>)> (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function TrimEnd(Of T As IEquatable(Of T)) (memory As ReadOnlyMemory(Of T), trimElements As ReadOnlySpan(Of T)) As ReadOnlyMemory(Of T)

類型參數

T

唯讀記憶體區域中的專案類型。

參數

memory
ReadOnlyMemory<T>

要從中移除元素的來源記憶體。

trimElements
ReadOnlySpan<T>

範圍,其中包含要移除的元素集。

傳回

ReadOnlyMemory<T>

修剪的唯讀記憶體區域。

備註

如果 trimElements 是空的,則會傳回未變更的記憶體。

適用於

TrimEnd<T>(Memory<T>, T)

從字元記憶體區域中移除所有尾端指定元素項目。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static Memory<T> TrimEnd(Memory<T> memory, T trimElement);
public static Memory<T> TrimEnd<T> (this Memory<T> memory, T trimElement) where T : IEquatable<T>;
static member TrimEnd : Memory<'T (requires 'T :> IEquatable<'T>)> * 'T -> Memory<'T (requires 'T :> IEquatable<'T>)> (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function TrimEnd(Of T As IEquatable(Of T)) (memory As Memory(Of T), trimElement As T) As Memory(Of T)

類型參數

T

記憶體區域中專案的型別。

參數

memory
Memory<T>

要從中移除元素的來源記憶體。

trimElement
T

要尋找並移除的指定元素。

傳回

Memory<T>

修剪的記憶體區域。

適用於

TrimEnd<T>(Memory<T>, ReadOnlySpan<T>)

從記憶體區域中移除唯讀範圍中指定的所有尾端元素集項目。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static Memory<T> TrimEnd(Memory<T> memory, ReadOnlySpan<T> trimElements);
public static Memory<T> TrimEnd<T> (this Memory<T> memory, ReadOnlySpan<T> trimElements) where T : IEquatable<T>;
static member TrimEnd : Memory<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> Memory<'T (requires 'T :> IEquatable<'T>)> (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function TrimEnd(Of T As IEquatable(Of T)) (memory As Memory(Of T), trimElements As ReadOnlySpan(Of T)) As Memory(Of T)

類型參數

T

記憶體區域中專案的型別。

參數

memory
Memory<T>

要從中移除元素的來源記憶體。

trimElements
ReadOnlySpan<T>

範圍,其中包含要移除的元素集。

傳回

Memory<T>

修剪的記憶體區域。

備註

如果 trimElements 是空的,則會傳回未變更的記憶體。

適用於

TrimEnd<T>(ReadOnlyMemory<T>, T)

從唯讀記憶體區域中移除所有尾端指定元素項目。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static ReadOnlyMemory<T> TrimEnd(ReadOnlyMemory<T> memory, T trimElement);
public static ReadOnlyMemory<T> TrimEnd<T> (this ReadOnlyMemory<T> memory, T trimElement) where T : IEquatable<T>;
static member TrimEnd : ReadOnlyMemory<'T (requires 'T :> IEquatable<'T>)> * 'T -> ReadOnlyMemory<'T (requires 'T :> IEquatable<'T>)> (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function TrimEnd(Of T As IEquatable(Of T)) (memory As ReadOnlyMemory(Of T), trimElement As T) As ReadOnlyMemory(Of T)

類型參數

T

唯讀記憶體區域中的專案類型。

參數

memory
ReadOnlyMemory<T>

要從中移除元素的來源記憶體。

trimElement
T

要尋找並移除的指定元素。

傳回

ReadOnlyMemory<T>

修剪的唯讀記憶體區域。

適用於