SpanExtensionsReadToSeparator(ReadOnlySpanChar, ReadOnlySpanChar) Method
Advances the specified
rest parameter after the next
separator and returns
the consumed part without the
separator. If
rest started with
separator
before the call, then an empty span is returned. If the whole
ReadOnlySpan<char> has been processed,
then
rest will be
ReadOnlySpan<char>.Empty after returning.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
public static ReadOnlySpan<char> ReadToSeparator(
this ref ReadOnlySpan<char> rest,
ReadOnlySpan<char> separator
)
<ExtensionAttribute>
Public Shared Function ReadToSeparator (
ByRef rest As ReadOnlySpan(Of Char),
separator As ReadOnlySpan(Of Char)
) As ReadOnlySpan(Of Char)
public:
[ExtensionAttribute]
static ReadOnlySpan<wchar_t> ReadToSeparator(
ReadOnlySpan<wchar_t>% rest,
ReadOnlySpan<wchar_t> separator
)
[<ExtensionAttribute>]
static member ReadToSeparator :
rest : ReadOnlySpan<char> byref *
separator : ReadOnlySpan<char> -> ReadOnlySpan<char>
- rest ReadOnlySpanChar
- Represents the rest of the string to process. When this method returns, the value of this
parameter will be the remaining unprocessed part, or ReadOnlySpan<char>.Empty if the whole span has been processed.
- separator ReadOnlySpanChar
- The separator to search in the specified span.
ReadOnlySpanCharA
ReadOnlySpan<char> that contains the first segment of the original value of the
rest parameter delimited by the specified
separator,
or the complete original value of
rest if it contained no more separators.In Visual Basic and C#, you can call this method as an instance method on any object of type
ReadOnlySpanChar. 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).