{
ReadOnlySpan<T> span = memory.Span;
int start = ClampStart(span, trimElement);
- int length = ClampEnd(span, start + 1, trimElement);
+ int length = ClampEnd(span, start, trimElement);
return memory.Slice(start, length);
}
{
ReadOnlySpan<T> span = memory.Span;
int start = ClampStart(span, trimElement);
- int length = ClampEnd(span, start + 1, trimElement);
+ int length = ClampEnd(span, start, trimElement);
return memory.Slice(start, length);
}
where T : IEquatable<T>
{
int start = ClampStart(span, trimElement);
- int length = ClampEnd(span, start + 1, trimElement);
+ int length = ClampEnd(span, start, trimElement);
return span.Slice(start, length);
}
where T : IEquatable<T>
{
int start = ClampStart(span, trimElement);
- int length = ClampEnd(span, start + 1, trimElement);
+ int length = ClampEnd(span, start, trimElement);
return span.Slice(start, length);
}
{
ReadOnlySpan<T> span = memory.Span;
int start = ClampStart(span, trimElements);
- int length = ClampEnd(span, start + 1, trimElements);
+ int length = ClampEnd(span, start, trimElements);
return memory.Slice(start, length);
}
{
ReadOnlySpan<T> span = memory.Span;
int start = ClampStart(span, trimElements);
- int length = ClampEnd(span, start + 1, trimElements);
+ int length = ClampEnd(span, start, trimElements);
return memory.Slice(start, length);
}
if (trimElements.Length > 1)
{
int start = ClampStart(span, trimElements);
- int length = ClampEnd(span, start + 1, trimElements);
+ int length = ClampEnd(span, start, trimElements);
return span.Slice(start, length);
}
if (trimElements.Length > 1)
{
int start = ClampStart(span, trimElements);
- int length = ClampEnd(span, start + 1, trimElements);
+ int length = ClampEnd(span, start, trimElements);
return span.Slice(start, length);
}
{
ReadOnlySpan<char> span = memory.Span;
int start = ClampStart(span);
- int length = ClampEnd(span, start + 1);
+ int length = ClampEnd(span, start);
return memory.Slice(start, length);
}
{
ReadOnlySpan<char> span = memory.Span;
int start = ClampStart(span);
- int length = ClampEnd(span, start + 1);
+ int length = ClampEnd(span, start);
return memory.Slice(start, length);
}
public static Span<char> Trim(this Span<char> span)
{
int start = ClampStart(span);
- int length = ClampEnd(span, start + 1);
+ int length = ClampEnd(span, start);
return span.Slice(start, length);
}