Trim()

System::MemoryExtensions::Trim(const ReadOnlySpan<T>&, T) function

Trims specified element from both ends of a typed span.

template<typename T> ReadOnlySpan<T> System::MemoryExtensions::Trim(const ReadOnlySpan<T> &span, T trimElement)

Template parameters

ParameterDescription
TThe type of elements in the span

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<T>&The span to trim
trimElementTThe element to trim

Return Value

A new span with the specified element trimmed from both ends

System::MemoryExtensions::Trim(Span<T>&, T) function

Trims specified element from both ends of a mutable typed span.

template<typename T> Span<T> System::MemoryExtensions::Trim(Span<T> &span, T trimElement)

Template parameters

ParameterDescription
TThe type of elements in the span

Arguments

ParameterTypeDescription
spanSpan<T>&The mutable span to trim
trimElementTThe element to trim

Return Value

A new span with the specified element trimmed from both ends

System::MemoryExtensions::Trim(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&) function

Trims specified elements from both ends of a typed span.

template<typename T> ReadOnlySpan<T> System::MemoryExtensions::Trim(const ReadOnlySpan<T> &span, const ReadOnlySpan<T> &trimElements)

Template parameters

ParameterDescription
TThe type of elements in the span

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<T>&The span to trim
trimElementsconst ReadOnlySpan<T>&The elements to trim

Return Value

A new span with the specified elements trimmed from both ends

System::MemoryExtensions::Trim(Span<T>&, const ReadOnlySpan<T>&) function

Trims specified elements from both ends of a mutable typed span.

template<typename T> Span<T> System::MemoryExtensions::Trim(Span<T> &span, const ReadOnlySpan<T> &trimElements)

Template parameters

ParameterDescription
TThe type of elements in the span

Arguments

ParameterTypeDescription
spanSpan<T>&The mutable span to trim
trimElementsconst ReadOnlySpan<T>&The elements to trim

Return Value

A new span with the specified elements trimmed from both ends

System::MemoryExtensions::Trim(const ReadOnlySpan<char16_t>&) function

Trims whitespace characters from both ends of a character span.

ReadOnlySpan<char16_t> System::MemoryExtensions::Trim(const ReadOnlySpan<char16_t> &span)

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<char16_t>&The character span to trim

Return Value

A new span with whitespace trimmed from both ends

System::MemoryExtensions::Trim(Span<char16_t>&) function

Trims whitespace characters from both ends of a mutable character span.

Span<char16_t> System::MemoryExtensions::Trim(Span<char16_t> &span)

Arguments

ParameterTypeDescription
spanSpan<char16_t>&The mutable character span to trim

Return Value

A new span with whitespace trimmed from both ends

See Also