Method LastIndexOfAnyExcept
LastIndexOfAnyExcept<T>(ExSpan<T>, T)
Searches for the last index of any value other than the specified value
.
public static nint LastIndexOfAnyExcept<T>(this ExSpan<T> span, T value) where T : IEquatable<T>?
Parameters
span
ExSpan<T>The span to search.
value
TA value to avoid.
Returns
- nint
The index in the span of the last occurrence of any value other than
value
. If all of the values arevalue
, returns -1.
Type Parameters
T
The type of the span and values.
LastIndexOfAnyExcept<T>(ExSpan<T>, T, T)
Searches for the last index of any value other than the specified value0
or value1
.
public static nint LastIndexOfAnyExcept<T>(this ExSpan<T> span, T value0, T value1) where T : IEquatable<T>?
Parameters
span
ExSpan<T>The span to search.
value0
TA value to avoid.
value1
TA value to avoid
Returns
- nint
The index in the span of the last occurrence of any value other than
value0
andvalue1
. If all of the values arevalue0
orvalue1
, returns -1.
Type Parameters
T
The type of the span and values.
LastIndexOfAnyExcept<T>(ExSpan<T>, T, T, T)
Searches for the last index of any value other than the specified value0
, value1
, or value2
.
public static nint LastIndexOfAnyExcept<T>(this ExSpan<T> span, T value0, T value1, T value2) where T : IEquatable<T>?
Parameters
span
ExSpan<T>The span to search.
value0
TA value to avoid.
value1
TA value to avoid
value2
TA value to avoid
Returns
- nint
The index in the span of the last occurrence of any value other than
value0
,value1
, andvalue2
. If all of the values arevalue0
,value1
, andvalue2
, returns -1.
Type Parameters
T
The type of the span and values.
LastIndexOfAnyExcept<T>(ExSpan<T>, ReadOnlyExSpan<T>)
Searches for the last index of any value other than the specified values
.
public static nint LastIndexOfAnyExcept<T>(this ExSpan<T> span, ReadOnlyExSpan<T> values) where T : IEquatable<T>?
Parameters
span
ExSpan<T>The span to search.
values
ReadOnlyExSpan<T>The values to avoid.
Returns
- nint
The index in the span of the last occurrence of any value other than those in
values
. If all of the values are invalues
, returns -1.
Type Parameters
T
The type of the span and values.
LastIndexOfAnyExcept<T>(ReadOnlyExSpan<T>, T)
Searches for the last index of any value other than the specified value
.
public static nint LastIndexOfAnyExcept<T>(this ReadOnlyExSpan<T> span, T value) where T : IEquatable<T>?
Parameters
span
ReadOnlyExSpan<T>The span to search.
value
TA value to avoid.
Returns
- nint
The index in the span of the last occurrence of any value other than
value
. If all of the values arevalue
, returns -1.
Type Parameters
T
The type of the span and values.
LastIndexOfAnyExcept<T>(ReadOnlyExSpan<T>, T, IEqualityComparer<T>?)
Searches for the last index of any value other than the specified value
.
public static nint LastIndexOfAnyExcept<T>(this ReadOnlyExSpan<T> span, T value, IEqualityComparer<T>? comparer = null)
Parameters
span
ReadOnlyExSpan<T>The span to search.
value
TA value to avoid.
comparer
IEqualityComparer<T>The IEqualityComparer<T> implementation to use when comparing elements, or null to use the default IEqualityComparer<T> for the type of an element.
Returns
- nint
The index in the span of the last occurrence of any value other than
value
. If all of the values arevalue
, returns -1.
Type Parameters
T
The type of the span and values.
LastIndexOfAnyExcept<T>(ReadOnlyExSpan<T>, T, T)
Searches for the last index of any value other than the specified value0
or value1
.
public static nint LastIndexOfAnyExcept<T>(this ReadOnlyExSpan<T> span, T value0, T value1) where T : IEquatable<T>?
Parameters
span
ReadOnlyExSpan<T>The span to search.
value0
TA value to avoid.
value1
TA value to avoid
Returns
- nint
The index in the span of the last occurrence of any value other than
value0
andvalue1
. If all of the values arevalue0
orvalue1
, returns -1.
Type Parameters
T
The type of the span and values.
LastIndexOfAnyExcept<T>(ReadOnlyExSpan<T>, T, T, IEqualityComparer<T>?)
Searches for the last index of any value other than the specified value0
or value1
.
public static nint LastIndexOfAnyExcept<T>(this ReadOnlyExSpan<T> span, T value0, T value1, IEqualityComparer<T>? comparer = null)
Parameters
span
ReadOnlyExSpan<T>The span to search.
value0
TA value to avoid.
value1
TA value to avoid
comparer
IEqualityComparer<T>The IEqualityComparer<T> implementation to use when comparing elements, or null to use the default IEqualityComparer<T> for the type of an element.
Returns
- nint
The index in the span of the last occurrence of any value other than
value0
andvalue1
. If all of the values arevalue0
orvalue1
, returns -1.
Type Parameters
T
The type of the span and values.
LastIndexOfAnyExcept<T>(ReadOnlyExSpan<T>, T, T, T)
Searches for the last index of any value other than the specified value0
, value1
, or value2
.
public static nint LastIndexOfAnyExcept<T>(this ReadOnlyExSpan<T> span, T value0, T value1, T value2) where T : IEquatable<T>?
Parameters
span
ReadOnlyExSpan<T>The span to search.
value0
TA value to avoid.
value1
TA value to avoid
value2
TA value to avoid
Returns
- nint
The index in the span of the last occurrence of any value other than
value0
,value1
, andvalue2
. If all of the values arevalue0
,value1
, andvalue2
, returns -1.
Type Parameters
T
The type of the span and values.
LastIndexOfAnyExcept<T>(ReadOnlyExSpan<T>, T, T, T, IEqualityComparer<T>?)
Searches for the last index of any value other than the specified value0
, value1
, or value2
.
public static nint LastIndexOfAnyExcept<T>(this ReadOnlyExSpan<T> span, T value0, T value1, T value2, IEqualityComparer<T>? comparer = null)
Parameters
span
ReadOnlyExSpan<T>The span to search.
value0
TA value to avoid.
value1
TA value to avoid
value2
TA value to avoid
comparer
IEqualityComparer<T>The IEqualityComparer<T> implementation to use when comparing elements, or null to use the default IEqualityComparer<T> for the type of an element.
Returns
- nint
The index in the span of the last occurrence of any value other than
value0
,value1
, andvalue2
. If all of the values arevalue0
,value1
, andvalue2
, returns -1.
Type Parameters
T
The type of the span and values.
LastIndexOfAnyExcept<T>(ReadOnlyExSpan<T>, ReadOnlyExSpan<T>)
Searches for the last index of any value other than the specified values
.
public static nint LastIndexOfAnyExcept<T>(this ReadOnlyExSpan<T> span, ReadOnlyExSpan<T> values) where T : IEquatable<T>?
Parameters
span
ReadOnlyExSpan<T>The span to search.
values
ReadOnlyExSpan<T>The values to avoid.
Returns
- nint
The index in the span of the first occurrence of any value other than those in
values
. If all of the values are invalues
, returns -1.
Type Parameters
T
The type of the span and values.
LastIndexOfAnyExcept<T>(ReadOnlyExSpan<T>, ReadOnlyExSpan<T>, IEqualityComparer<T>?)
Searches for the last index of any value other than the specified values
.
public static nint LastIndexOfAnyExcept<T>(this ReadOnlyExSpan<T> span, ReadOnlyExSpan<T> values, IEqualityComparer<T>? comparer = null)
Parameters
span
ReadOnlyExSpan<T>The span to search.
values
ReadOnlyExSpan<T>The values to avoid.
comparer
IEqualityComparer<T>The IEqualityComparer<T> implementation to use when comparing elements, or null to use the default IEqualityComparer<T> for the type of an element.
Returns
- nint
The index in the span of the first occurrence of any value other than those in
values
. If all of the values are invalues
, returns -1.
Type Parameters
T
The type of the span and values.