MemoryExtensionsSplitOnceLastAnyT(ReadOnlyMemoryT, ReadOnlySpanT) Method

Splits a ReadOnlyMemoryT into two parts at the last occurrence of any of the specified separators.

Definition

Namespace: Ookii.Common
Assembly: Ookii.Common (in Ookii.Common.dll) Version: 1.0.0+7c2900b8a16cd8ae46bdd79d8f105034712c5fa3
C#
public static (ReadOnlyMemory<T> , ReadOnlyMemory<T> )? SplitOnceLastAny<T>(
	this ReadOnlyMemory<T> memory,
	ReadOnlySpan<T> separators
)
where T : Object, IEquatable<T>

Parameters

memory  ReadOnlyMemoryT
The ReadOnlyMemoryT to split.
separators  ReadOnlySpanT
The set of separators to split the memory at.

Type Parameters

T
The type of the items in the ReadOnlyMemoryT.

Return Value

NullableValueTupleReadOnlyMemoryT, ReadOnlyMemoryT
If a separator was found, a tuple containing the parts before and after the separator; otherwise, .

Usage Note

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).

See Also