MemoryExtensionsSplitOnceAnyT(ReadOnlyMemoryT, ReadOnlySpanT) Method
Splits a
ReadOnlyMemoryT into two parts at the first occurrence of any of the
specified separators.
Namespace: Ookii.CommonAssembly: Ookii.Common (in Ookii.Common.dll) Version: 1.0.0+7c2900b8a16cd8ae46bdd79d8f105034712c5fa3
public static (ReadOnlyMemory<T> , ReadOnlyMemory<T> )? SplitOnceAny<T>(
this ReadOnlyMemory<T> memory,
ReadOnlySpan<T> separators
)
where T : Object, IEquatable<T>
<ExtensionAttribute>
Public Shared Function SplitOnceAny(Of T As {Object, IEquatable(Of T)}) (
memory As ReadOnlyMemory(Of T),
separators As ReadOnlySpan(Of T)
) As ( As ReadOnlyMemory(Of T), As ReadOnlyMemory(Of T))?
Dim memory As ReadOnlyMemory(Of T)
Dim separators As ReadOnlySpan(Of T)
Dim returnValue As ( As ReadOnlyMemory(Of T), As ReadOnlyMemory(Of T))?
returnValue = memory.SplitOnceAny(separators)
public:
[ExtensionAttribute]
generic<typename T>
where T : Object, IEquatable<T>
static Nullable<ValueTuple<ReadOnlyMemory<T>, ReadOnlyMemory<T>>> SplitOnceAny(
ReadOnlyMemory<T> memory,
ReadOnlySpan<T> separators
)
- memory ReadOnlyMemoryT
- The ReadOnlyMemoryT to split.
- separators ReadOnlySpanT
- The set of separators to split the memory region at.
- T
- The type of the items in the ReadOnlyMemoryT.
NullableValueTupleReadOnlyMemoryT,
ReadOnlyMemoryT
If a separator was found, a tuple containing the parts before and after the separator;
otherwise,
.
In Visual Basic and C#, you can call this method as an instance method on any object of type
ReadOnlyMemoryT. 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).