Method TrimEnd
TrimEnd<T>(ExSpan<T>, T)
Removes all trailing occurrences of a specified element from the span.
public static ExSpan<T> TrimEnd<T>(this ExSpan<T> span, T trimElement) where T : IEquatable<T>?
Parameters
span
ExSpan<T>The source span from which the element is removed.
trimElement
TThe specified element to look for and remove.
Returns
- ExSpan<T>
Type Parameters
T
TrimEnd<T>(ReadOnlyExSpan<T>, T)
Removes all trailing occurrences of a specified element from the span.
public static ReadOnlyExSpan<T> TrimEnd<T>(this ReadOnlyExSpan<T> span, T trimElement) where T : IEquatable<T>?
Parameters
span
ReadOnlyExSpan<T>The source span from which the element is removed.
trimElement
TThe specified element to look for and remove.
Returns
Type Parameters
T
TrimEnd<T>(ExSpan<T>, ReadOnlyExSpan<T>)
Removes all trailing occurrences of a set of elements specified in a readonly span from the span.
public static ExSpan<T> TrimEnd<T>(this ExSpan<T> span, ReadOnlyExSpan<T> trimElements) where T : IEquatable<T>?
Parameters
span
ExSpan<T>The source span from which the elements are removed.
trimElements
ReadOnlyExSpan<T>The span which contains the set of elements to remove.
Returns
- ExSpan<T>
Type Parameters
T
Remarks
If trimElements
is empty, the span is returned unaltered.
TrimEnd<T>(ReadOnlyExSpan<T>, ReadOnlyExSpan<T>)
Removes all trailing occurrences of a set of elements specified in a readonly span from the span.
public static ReadOnlyExSpan<T> TrimEnd<T>(this ReadOnlyExSpan<T> span, ReadOnlyExSpan<T> trimElements) where T : IEquatable<T>?
Parameters
span
ReadOnlyExSpan<T>The source span from which the elements are removed.
trimElements
ReadOnlyExSpan<T>The span which contains the set of elements to remove.
Returns
Type Parameters
T
Remarks
If trimElements
is empty, the span is returned unaltered.
TrimEnd(ReadOnlyExSpan<char>)
Removes all trailing white-space characters from the span.
public static ReadOnlyExSpan<char> TrimEnd(this ReadOnlyExSpan<char> span)
Parameters
span
ReadOnlyExSpan<char>The source span from which the characters are removed.
Returns
TrimEnd(ReadOnlyExSpan<char>, char)
Removes all trailing occurrences of a specified character from the span.
public static ReadOnlyExSpan<char> TrimEnd(this ReadOnlyExSpan<char> span, char trimChar)
Parameters
span
ReadOnlyExSpan<char>The source span from which the character is removed.
trimChar
charThe specified character to look for and remove.
Returns
TrimEnd(ReadOnlyExSpan<char>, ReadOnlyExSpan<char>)
Removes all trailing occurrences of a set of characters specified in a readonly span from the span.
public static ReadOnlyExSpan<char> TrimEnd(this ReadOnlyExSpan<char> span, ReadOnlyExSpan<char> trimChars)
Parameters
span
ReadOnlyExSpan<char>The source span from which the characters are removed.
trimChars
ReadOnlyExSpan<char>The span which contains the set of characters to remove.
Returns
Remarks
If trimChars
is empty, white-space characters are removed instead.
TrimEnd(ExSpan<char>)
Removes all trailing white-space characters from the span.
public static ExSpan<char> TrimEnd(this ExSpan<char> span)