MemoryExtensions.StripPrefix(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) Method
Removes a prefix from a span of characters.
Namespace: Ookii.CommonAssembly: Ookii.Common (in Ookii.Common.dll) Version: 1.0.0+7c2900b8a16cd8ae46bdd79d8f105034712c5fa3
public static NullableReadOnlySpan<char> StripPrefix(
this ReadOnlySpan<char> span,
ReadOnlySpan<char> prefix,
StringComparison comparisonType
)
<ExtensionAttribute>
Public Shared Function StripPrefix (
span As ReadOnlySpan(Of Char),
prefix As ReadOnlySpan(Of Char),
comparisonType As StringComparison
) As NullableReadOnlySpan(Of Char)
Dim span As ReadOnlySpan(Of Char)
Dim prefix As ReadOnlySpan(Of Char)
Dim comparisonType As StringComparison
Dim returnValue As NullableReadOnlySpan(Of Char)
returnValue = span.StripPrefix(prefix,
comparisonType)
public:
[ExtensionAttribute]
static NullableReadOnlySpan<wchar_t> StripPrefix(
ReadOnlySpan<wchar_t> span,
ReadOnlySpan<wchar_t> prefix,
StringComparison comparisonType
)
- span ReadOnlySpan<Char>
- The span of characters to remove the prefix from.
- prefix ReadOnlySpan<Char>
- The prefix to remove.
- comparisonType StringComparison
- The type of string comparison to use to match the prefix.
NullableReadOnlySpan<Char>
If
span starts with
prefix, returns the span without
the prefix; 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<Char>. 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).