StringSegmentSplit(StringSegment, StringSegmentSplitOptions) Method

Splits this StringSegment instance into a collection of StringSegment instances without allocating new strings. Alternatively, you can use the ReadToSeparator(StringSegment, StringSegment) extension method.
See the Remarks section of the StringSegment type for details and some examples.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
public IList<StringSegment> Split(
	StringSegment[]? separators,
	StringSegmentSplitOptions options
)

Parameters

separators  StringSegment
An array of StringSegment instances that delimits the segments in this StringSegment. If or contains no elements, then the split operation will use whitespace separators. If contains only or empty elements, then no splitting will occur.
options  StringSegmentSplitOptions
A StringSegmentSplitOptions value that specifies whether to trim segments and remove empty entries.

Return Value

IListStringSegment
A list of StringSegment instances, whose elements contain the substrings in this StringSegment that are delimited by separators.

See Also