StringSegmentSplit(Char, NullableInt32, StringSegmentSplitOptions) Method

Splits this StringSegment instance into a collection of StringSegment instances of no more than maxLength segments, 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: 9.0.0-preview.1
C#
public IList<StringSegment> Split(
	char separator,
	int? maxLength = null,
	StringSegmentSplitOptions options = default
)

Parameters

separator  Char
A character that delimits the segments in this StringSegment.
maxLength  NullableInt32  (Optional)
The maximum number of segments to return. If , then the whole string is processed represented by this StringSegment. This parameter is optional.
Default value: .
options  StringSegmentSplitOptions  (Optional)
A StringSegmentSplitOptions value that specifies whether to trim segments and remove empty entries. This parameter is optional.
Default value: None.

Return Value

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

See Also