Table of Contents

Method Trim

Namespace
Zyl.ExSpans
Assembly
ExSpans.dll

Trim<T>(ExSpan<T>, T)

Removes all leading and trailing occurrences of a specified element from the span.

public static ExSpan<T> Trim<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 T

The specified element to look for and remove.

Returns

ExSpan<T>

Type Parameters

T

Trim<T>(ReadOnlyExSpan<T>, T)

Removes all leading and trailing occurrences of a specified element from the span.

public static ReadOnlyExSpan<T> Trim<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 T

The specified element to look for and remove.

Returns

ReadOnlyExSpan<T>

Type Parameters

T

Trim<T>(ExSpan<T>, ReadOnlyExSpan<T>)

Removes all leading and trailing occurrences of a set of elements specified in a readonly span from the span.

public static ExSpan<T> Trim<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.

Trim<T>(ReadOnlyExSpan<T>, ReadOnlyExSpan<T>)

Removes all leading and trailing occurrences of a set of elements specified in a readonly span from the span.

public static ReadOnlyExSpan<T> Trim<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

ReadOnlyExSpan<T>

Type Parameters

T

Remarks

If trimElements is empty, the span is returned unaltered.

Trim(ReadOnlyExSpan<char>)

Removes all leading and trailing white-space characters from the span.

public static ReadOnlyExSpan<char> Trim(this ReadOnlyExSpan<char> span)

Parameters

span ReadOnlyExSpan<char>

The source span from which the characters are removed.

Returns

ReadOnlyExSpan<char>

Trim(ReadOnlyExSpan<char>, char)

Removes all leading and trailing occurrences of a specified character from the span.

public static ReadOnlyExSpan<char> Trim(this ReadOnlyExSpan<char> span, char trimChar)

Parameters

span ReadOnlyExSpan<char>

The source span from which the character is removed.

trimChar char

The specified character to look for and remove.

Returns

ReadOnlyExSpan<char>

Trim(ReadOnlyExSpan<char>, ReadOnlyExSpan<char>)

Removes all leading and trailing occurrences of a set of characters specified in a readonly span from the span.

public static ReadOnlyExSpan<char> Trim(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

ReadOnlyExSpan<char>

Remarks

If trimChars is empty, white-space characters are removed instead.

Trim(ExSpan<char>)

Removes all leading and trailing white-space characters from the span.

public static ExSpan<char> Trim(this ExSpan<char> span)

Parameters

span ExSpan<char>

The source span from which the characters are removed.

Returns

ExSpan<char>