MemoryExtensions.StripSuffix<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) Method
Namespace: Ookii.CommonAssembly: Ookii.Common (in Ookii.Common.dll) Version: 1.0.0+7c2900b8a16cd8ae46bdd79d8f105034712c5fa3
public static NullableReadOnlySpan<T> StripSuffix<T>(
this ReadOnlySpan<T> span,
ReadOnlySpan<T> suffix
)
where T : Object, IEquatable<T>
<ExtensionAttribute>
Public Shared Function StripSuffix(Of T As {Object, IEquatable(Of T)}) (
span As ReadOnlySpan(Of T),
suffix As ReadOnlySpan(Of T)
) As NullableReadOnlySpan(Of T)
Dim span As ReadOnlySpan(Of T)
Dim suffix As ReadOnlySpan(Of T)
Dim returnValue As NullableReadOnlySpan(Of T)
returnValue = span.StripSuffix(suffix)
public:
[ExtensionAttribute]
generic<typename T>
where T : Object, IEquatable<T>
static NullableReadOnlySpan<T> StripSuffix(
ReadOnlySpan<T> span,
ReadOnlySpan<T> suffix
)
- span ReadOnlySpan<T>
- The ReadOnlySpan<T> to remove the suffix from.
- suffix ReadOnlySpan<T>
- The suffix to move.
- T
- The type of the items in the ReadOnlySpan<T>.
NullableReadOnlySpan<T>
If
span ends with
suffix, returns the span without
the suffix; otherwise, returns an empty
NullableReadOnlySpan<T>.
In Visual Basic and C#, you can call this method as an instance method on any object of type
ReadOnlySpan<T>. 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).