Span Struct (System) (original) (raw)

Empty

Returns an empty Span object.

IsEmpty

Returns a value that indicates whether the current Span is empty.

Item[Int32]

Gets the element at the specified zero-based index.

Length

Returns the length of the current span.

ToImmutableArray(Span)

Converts the span to an immutable array.

BinarySearch(Span, IComparable)

Searches an entire sorted Span for a value using the specified IComparable generic interface.

BinarySearch<T,TComparer>(Span, T, TComparer)

Searches an entire sorted Span for a specified value using the specified TComparer generic type.

BinarySearch<T,TComparable>(Span, TComparable)

Searches an entire sorted Span for a value using the specified TComparable generic type.

CommonPrefixLength(Span, ReadOnlySpan, IEqualityComparer)

Finds the length of any common prefix shared between span and other.

CommonPrefixLength(Span, ReadOnlySpan)

Finds the length of any common prefix shared between span and other.

Contains(Span, T)

Indicates whether a specified value is found in a span. Values are compared using IEquatable{T}.Equals(T).

ContainsAny(Span, T, T, T)

Searches for an occurrence of value0, value1, or value2, and returns true if found. If not found, returns false.

ContainsAny(Span, T, T)

Searches for an occurrence of value0 or value1, and returns true if found. If not found, returns false.

ContainsAny(Span, SearchValues)

Searches for an occurrence of any of the specified values and returns true if found. If not found, returns false.

ContainsAny(Span, ReadOnlySpan)

Searches for an occurrence of any of the specified values and returns true if found. If not found, returns false.

ContainsAnyExcept(Span, T, T, T)

Searches for any value other than value0, value1, or value2.

ContainsAnyExcept(Span, T, T)

Searches for any value other than value0 or value1.

ContainsAnyExcept(Span, T)

Searches for any value other than the specified value.

ContainsAnyExcept(Span, SearchValues)

Searches for any value other than the specified values.

ContainsAnyExcept(Span, ReadOnlySpan)

Searches for any value other than the specified values.

ContainsAnyExceptInRange(Span, T, T)

Searches for any value outside of the range between lowInclusive and highInclusive, inclusive.

ContainsAnyInRange(Span, T, T)

Searches for any value in the range between lowInclusive and highInclusive, inclusive, and returns true if found. If not found, returns false.

Count(Span, T)

Counts the number of times the specified value occurs in the span.

Count(Span, ReadOnlySpan)

Counts the number of times the specified value occurs in the span.

EndsWith(Span, ReadOnlySpan)

Determines whether the specified sequence appears at the end of a span.

IndexOf(Span, T)

Searches for the specified value and returns the index of its first occurrence. Values are compared using IEquatable{T}.Equals(T).

IndexOf(Span, ReadOnlySpan)

Searches for the specified sequence and returns the index of its first occurrence. Values are compared using IEquatable{T}.Equals(T).

IndexOfAny(Span, T, T, T)

Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

IndexOfAny(Span, T, T)

Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

IndexOfAny(Span, SearchValues)

Searches for the first index of any of the specified values.

IndexOfAny(Span, ReadOnlySpan)

Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

IndexOfAnyExcept(Span, T, T, T)

Searches for the first index of any value other than the specified value0, value1, or value2.

IndexOfAnyExcept(Span, T, T)

Searches for the first index of any value other than the specified value0 or value1.

IndexOfAnyExcept(Span, T)

Searches for the first index of any value other than the specified value.

IndexOfAnyExcept(Span, SearchValues)

Searches for the first index of any value other than the specified values.

IndexOfAnyExcept(Span, ReadOnlySpan)

Searches for the first index of any value other than the specified values.

IndexOfAnyExceptInRange(Span, T, T)

Searches for the first index of any value outside of the range between lowInclusive and highInclusive, inclusive.

IndexOfAnyInRange(Span, T, T)

Searches for the first index of any value in the range between lowInclusive and highInclusive, inclusive.

LastIndexOf(Span, T)

Searches for the specified value and returns the index of its last occurrence. Values are compared using IEquatable{T}.Equals(T).

LastIndexOf(Span, ReadOnlySpan)

Searches for the specified sequence and returns the index of its last occurrence. Values are compared using IEquatable{T}.Equals(T).

LastIndexOfAny(Span, T, T, T)

Searches for the last index of any of the specified values similar to calling LastIndexOf several times with the logical OR operator.

LastIndexOfAny(Span, T, T)

Searches for the last index of any of the specified values similar to calling LastIndexOf several times with the logical OR operator.

LastIndexOfAny(Span, SearchValues)

Searches for the last index of any of the specified values.

LastIndexOfAny(Span, ReadOnlySpan)

Searches for the last index of any of the specified values similar to calling LastIndexOf several times with the logical OR operator.

LastIndexOfAnyExcept(Span, T, T, T)

Searches for the last index of any value other than the specified value0, value1, or value2.

LastIndexOfAnyExcept(Span, T, T)

Searches for the last index of any value other than the specified value0 or value1.

LastIndexOfAnyExcept(Span, T)

Searches for the last index of any value other than the specified value.

LastIndexOfAnyExcept(Span, SearchValues)

Searches for the last index of any value other than the specified values.

LastIndexOfAnyExcept(Span, ReadOnlySpan)

Searches for the last index of any value other than the specified values.

LastIndexOfAnyExceptInRange(Span, T, T)

Searches for the last index of any value outside of the range between lowInclusive and highInclusive, inclusive.

LastIndexOfAnyInRange(Span, T, T)

Searches for the last index of any value in the range between lowInclusive and highInclusive, inclusive.

Overlaps(Span, ReadOnlySpan, Int32)

Determines whether a span and a read-only span overlap in memory and outputs the element offset.

Overlaps(Span, ReadOnlySpan)

Determines whether a span and a read-only span overlap in memory.

Replace(Span, T, T, IEqualityComparer)

Replace(Span, T, T)

Replaces all occurrences of oldValue with newValue.

ReplaceAny(Span, SearchValues, T)

ReplaceAnyExcept(Span, SearchValues, T)

Reverse(Span)

Reverses the sequence of the elements in the entire span.

SequenceCompareTo(Span, ReadOnlySpan)

Determines the relative order of a span and a read-only span by comparing the elements using IComparable{T}.CompareTo(T).

SequenceEqual(Span, ReadOnlySpan, IEqualityComparer)

Determines whether two sequences are equal by comparing the elements using an IEqualityComparer.

SequenceEqual(Span, ReadOnlySpan)

Determines whether a span and a read-only span are equal by comparing the elements using IEquatable{T}.Equals(T).

Sort(Span, Comparison)

Sorts the elements in the entire Span using the specified Comparison.

Sort(Span)

Sorts the elements in the entire Span using the IComparable implementation of each element of the Span.

Sort<T,TComparer>(Span, TComparer)

Sorts the elements in the entire Span using the TComparer.

Sort<TKey,TValue>(Span, Span, Comparison)

Sorts a pair of spans (one containing the keys and the other containing the corresponding items) based on the keys in the first Span using the specified comparison.

Sort<TKey,TValue>(Span, Span)

Sorts a pair of spans (one containing the keys and the other containing the corresponding items) based on the keys in the first Span using the IComparable implementation of each key.

Sort<TKey,TValue,TComparer>(Span, Span, TComparer)

Sorts a pair of spans (one containing the keys and the other containing the corresponding items) based on the keys in the first Span using the specified comparer.

StartsWith(Span, ReadOnlySpan)

Determines whether a specified sequence appears at the start of a span.

Trim(Span, T)

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

Trim(Span, ReadOnlySpan)

Removes all leading and trailing occurrences of a set of elements specified in a read-only span from a span.

TrimEnd(Span, T)

Removes all trailing occurrences of a specified element from a span.

TrimEnd(Span, ReadOnlySpan)

Removes all trailing occurrences of a set of elements specified in a read-only span from a span.

TrimStart(Span, T)

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

TrimStart(Span, ReadOnlySpan)

Removes all leading occurrences of a set of elements specified in a read-only span from the span.