MemoryExtensions.SplitAny Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
SplitAny(ReadOnlySpan<Char>, Span<Range>, ReadOnlySpan<Char>, StringSplitOptions) |
Parses the source ReadOnlySpan<T> for one of the specified |
SplitAny(ReadOnlySpan<Char>, Span<Range>, ReadOnlySpan<String>, StringSplitOptions) |
Parses the source ReadOnlySpan<T> for one of the specified |
SplitAny(ReadOnlySpan<Char>, Span<Range>, ReadOnlySpan<Char>, StringSplitOptions)
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
Parses the source ReadOnlySpan<T> for one of the specified separators
, populating the destination
span with Range instances representing the regions between the separators.
public static int SplitAny (this ReadOnlySpan<char> source, Span<Range> destination, ReadOnlySpan<char> separators, StringSplitOptions options = System.StringSplitOptions.None);
static member SplitAny : ReadOnlySpan<char> * Span<Range> * ReadOnlySpan<char> * StringSplitOptions -> int
<Extension()>
Public Function SplitAny (source As ReadOnlySpan(Of Char), destination As Span(Of Range), separators As ReadOnlySpan(Of Char), Optional options As StringSplitOptions = System.StringSplitOptions.None) As Integer
Parameters
- source
- ReadOnlySpan<Char>
The source span to parse.
- separators
- ReadOnlySpan<Char>
Any number of characters that may delimit the regions in this instance. If empty, all Unicode whitespace characters are used as the separators.
- options
- StringSplitOptions
A bitwise combination of the enumeration values that specifies whether to trim whitespace and include empty ranges.
Returns
The number of ranges written into destination
.
Remarks
Delimiter characters are not included in the elements of the returned array.
If the destination
span is empty, or if the options
specifies RemoveEmptyEntries and source
is empty, or if options
specifies both RemoveEmptyEntries and TrimEntries and the source
is entirely whitespace, no ranges are written to the destination.
If the span does not contain any of the separators
, or if destination
's length is 1, a single range will be output containing the entire source
, subject to the processing implied by options
.
If there are more regions in source
than will fit in destination
, the first destination
length minus 1 ranges are stored in destination
, and a range for the remainder of source
is stored in destination
.
Applies to
SplitAny(ReadOnlySpan<Char>, Span<Range>, ReadOnlySpan<String>, StringSplitOptions)
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
Parses the source ReadOnlySpan<T> for one of the specified separators
, populating the destination
span with Range instances representing the regions between the separators.
public static int SplitAny (this ReadOnlySpan<char> source, Span<Range> destination, ReadOnlySpan<string> separators, StringSplitOptions options = System.StringSplitOptions.None);
static member SplitAny : ReadOnlySpan<char> * Span<Range> * ReadOnlySpan<string> * StringSplitOptions -> int
<Extension()>
Public Function SplitAny (source As ReadOnlySpan(Of Char), destination As Span(Of Range), separators As ReadOnlySpan(Of String), Optional options As StringSplitOptions = System.StringSplitOptions.None) As Integer
Parameters
- source
- ReadOnlySpan<Char>
The source span to parse.
- separators
- ReadOnlySpan<String>
Any number of strings that may delimit the regions in this instance. If empty, all Unicode whitespace characters are used as the separators.
- options
- StringSplitOptions
A bitwise combination of the enumeration values that specifies whether to trim whitespace and include empty ranges.
Returns
The number of ranges written into destination
.
Remarks
Delimiter characters are not included in the elements of the returned array.
If the destination
span is empty, or if the options
specifies RemoveEmptyEntries and source
is empty, or if options
specifies both RemoveEmptyEntries and TrimEntries and the source
is entirely whitespace, no ranges are written to the destination.
If the span does not contain any of the separators
, or if destination
's length is 1, a single range will be output containing the entire source
, subject to the processing implied by options
.
If there are more regions in source
than will fit in destination
, the first destination
length minus 1 ranges are stored in destination
, and a range for the remainder of source
is stored in destination
.
Applies to
משוב
https://aka.ms/ContentUserFeedback.
בקרוב: במהלך 2024, נפתור בעיות GitHub כמנגנון המשוב לתוכן ונחליף אותו במערכת משוב חדשה. לקבלת מידע נוסף, ראה:שלח והצג משוב עבור