StringSegmentSplit(Char, StringSegmentSplitOptions) Method

Splits this StringSegment instance into a collection of StringSegment instances without allocating new strings. Alternatively, you can use the ReadToSeparator(StringSegment, Char) 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: 10.0.0
C#
public IList<StringSegment> Split(
	char[]? separators,
	StringSegmentSplitOptions options
)

Parameters

separators  Char
An array of characters that delimits the segments in this StringSegment. If or contains no elements, then the split operation will use whitespace separators.
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