MemoryExtensionsStripSuffix(ReadOnlyMemoryChar, ReadOnlySpanChar, StringComparison) Method
Removes a suffix from a read-only memory region of characters.
Namespace: Ookii.CommonAssembly: Ookii.Common (in Ookii.Common.dll) Version: 1.0.0+7c2900b8a16cd8ae46bdd79d8f105034712c5fa3
public static ReadOnlyMemory<char>? StripSuffix(
this ReadOnlyMemory<char> memory,
ReadOnlySpan<char> suffix,
StringComparison comparisonType
)
<ExtensionAttribute>
Public Shared Function StripSuffix (
memory As ReadOnlyMemory(Of Char),
suffix As ReadOnlySpan(Of Char),
comparisonType As StringComparison
) As ReadOnlyMemory(Of Char)?
Dim memory As ReadOnlyMemory(Of Char)
Dim suffix As ReadOnlySpan(Of Char)
Dim comparisonType As StringComparison
Dim returnValue As ReadOnlyMemory(Of Char)?
returnValue = memory.StripSuffix(suffix,
comparisonType)
public:
[ExtensionAttribute]
static Nullable<ReadOnlyMemory<wchar_t>> StripSuffix(
ReadOnlyMemory<wchar_t> memory,
ReadOnlySpan<wchar_t> suffix,
StringComparison comparisonType
)
- memory ReadOnlyMemoryChar
- The memory region of characters to remove the suffix from.
- suffix ReadOnlySpanChar
- The suffix to remove.
- comparisonType StringComparison
- The type of string comparison to use to match the suffix.
NullableReadOnlyMemoryChar
If
memory ends with
suffix, returns the memory
without the suffix; otherwise, returns
.
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).