MemoryExtensions.TrimEnd Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| TrimEnd(ReadOnlySpan<Char>) |
Removes all trailing whitespace characters from a read-only character span. |
| TrimEnd(ReadOnlySpan<Char>, Char) |
Removes all trailing occurrences of a specified character from a read-only span. |
| TrimEnd(ReadOnlySpan<Char>, ReadOnlySpan<Char>) |
Removes all trailing occurrences of a set of characters specified in a read-only span from a read-only character span. |
TrimEnd(ReadOnlySpan<Char>)
Removes all trailing whitespace characters from a read-only character span.
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)
Parameters
- span
- ReadOnlySpan<Char>
The source span from which the characters are removed.
Returns
The trimmed read-only character span.
Applies to
TrimEnd(ReadOnlySpan<Char>, Char)
Removes all trailing occurrences of a specified character from a read-only span.
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)
Parameters
- span
- ReadOnlySpan<Char>
The source span from which the character is removed.
- trimChar
- Char
The specified character to look for and remove.
Returns
The trimmed read-only character span.
Applies to
TrimEnd(ReadOnlySpan<Char>, ReadOnlySpan<Char>)
Removes all trailing occurrences of a set of characters specified in a read-only span from a read-only character span.
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)
Parameters
- span
- ReadOnlySpan<Char>
The source span from which the characters are removed.
- trimChars
- ReadOnlySpan<Char>
The span which contains the set of characters to remove.
Returns
The trimmed read-only character span.
Remarks
If trimChars is empty, whitespace characters are removed instead.