MemoryExtensionsSplitOnceLast(ReadOnlyMemoryChar, ReadOnlySpanChar, StringComparison) Method
Splits a read-only memory region of characters into two parts at the last occurrence of a separator.
Namespace: Ookii.CommonAssembly: Ookii.Common (in Ookii.Common.dll) Version: 1.0.0+7c2900b8a16cd8ae46bdd79d8f105034712c5fa3
public static (ReadOnlyMemory<char> , ReadOnlyMemory<char> )? SplitOnceLast(
this ReadOnlyMemory<char> memory,
ReadOnlySpan<char> separator,
StringComparison comparisonType
)
<ExtensionAttribute>
Public Shared Function SplitOnceLast (
memory As ReadOnlyMemory(Of Char),
separator As ReadOnlySpan(Of Char),
comparisonType As StringComparison
) As ( As ReadOnlyMemory(Of Char), As ReadOnlyMemory(Of Char))?
Dim memory As ReadOnlyMemory(Of Char)
Dim separator As ReadOnlySpan(Of Char)
Dim comparisonType As StringComparison
Dim returnValue As ( As ReadOnlyMemory(Of Char), As ReadOnlyMemory(Of Char))?
returnValue = memory.SplitOnceLast(separator,
comparisonType)
public:
[ExtensionAttribute]
static Nullable<ValueTuple<ReadOnlyMemory<wchar_t>, ReadOnlyMemory<wchar_t>>> SplitOnceLast(
ReadOnlyMemory<wchar_t> memory,
ReadOnlySpan<wchar_t> separator,
StringComparison comparisonType
)
- memory ReadOnlyMemoryChar
- The memory region of characters to split.
- separator ReadOnlySpanChar
- A span of characters containing the separator to split on.
- comparisonType StringComparison
- The type of string comparison to use to find the separator.
NullableValueTupleReadOnlyMemoryChar,
ReadOnlyMemoryChar
If the 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
ReadOnlyMemoryChar. 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).