MemoryExtensions.SplitOnceLastAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) Method
Splits a
ReadOnlySpan<T> into two parts at the last occurrence of any of the
specified separators.
Namespace: Ookii.CommonAssembly: Ookii.Common (in Ookii.Common.dll) Version: 1.0.0+7c2900b8a16cd8ae46bdd79d8f105034712c5fa3
public static NullableReadOnlySpanPair<T, T> SplitOnceLastAny<T>(
this ReadOnlySpan<T> span,
ReadOnlySpan<T> separators
)
where T : Object, IEquatable<T>
<ExtensionAttribute>
Public Shared Function SplitOnceLastAny(Of T As {Object, IEquatable(Of T)}) (
span As ReadOnlySpan(Of T),
separators As ReadOnlySpan(Of T)
) As NullableReadOnlySpanPair(Of T, T)
Dim span As ReadOnlySpan(Of T)
Dim separators As ReadOnlySpan(Of T)
Dim returnValue As NullableReadOnlySpanPair(Of T, T)
returnValue = span.SplitOnceLastAny(separators)
public:
[ExtensionAttribute]
generic<typename T>
where T : Object, IEquatable<T>
static NullableReadOnlySpanPair<T, T> SplitOnceLastAny(
ReadOnlySpan<T> span,
ReadOnlySpan<T> separators
)
- span ReadOnlySpan<T>
- The ReadOnlySpan<T> to split.
- separators ReadOnlySpan<T>
- The set of separators to split the span at.
- T
- The type of the items in the ReadOnlySpan<T>.
NullableReadOnlySpanPair<T,
T>
If a separator was found, a
NullableReadOnlySpanPair<TFirst, TSecond> containing the
parts before and after the separator; otherwise, an empty
NullableReadOnlySpanPair<TFirst, TSecond>.
In Visual Basic and C#, you can call this method as an instance method on any object of type
ReadOnlySpan<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).