MemoryExtensionsStripSuffixT(ReadOnlyMemoryT, ReadOnlySpanT) Method
Namespace: Ookii.CommonAssembly: Ookii.Common (in Ookii.Common.dll) Version: 1.0.0+7c2900b8a16cd8ae46bdd79d8f105034712c5fa3
public static ReadOnlyMemory<T>? StripSuffix<T>(
this ReadOnlyMemory<T> memory,
ReadOnlySpan<T> suffix
)
where T : Object, IEquatable<T>
<ExtensionAttribute>
Public Shared Function StripSuffix(Of T As {Object, IEquatable(Of T)}) (
memory As ReadOnlyMemory(Of T),
suffix As ReadOnlySpan(Of T)
) As ReadOnlyMemory(Of T)?
Dim memory As ReadOnlyMemory(Of T)
Dim suffix As ReadOnlySpan(Of T)
Dim returnValue As ReadOnlyMemory(Of T)?
returnValue = memory.StripSuffix(suffix)
public:
[ExtensionAttribute]
generic<typename T>
where T : Object, IEquatable<T>
static Nullable<ReadOnlyMemory<T>> StripSuffix(
ReadOnlyMemory<T> memory,
ReadOnlySpan<T> suffix
)
- memory ReadOnlyMemoryT
- The ReadOnlyMemoryT to remove the suffix from.
- suffix ReadOnlySpanT
- The suffix to move.
- T
- The type of the items in the ReadOnlyMemoryT.
NullableReadOnlyMemoryT
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
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).