StringSegmentSplit(NullableInt32, StringSegmentSplitOptions) Method
Splits this
StringSegment instance into a collection of
StringSegment instances of no more than
maxLength segments, without allocating new strings.
This overload uses the whitespace characters as separators. Alternatively, you can use the
ReadToWhiteSpace extension method.
See the
Remarks section of the
StringSegment type for details and some examples.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
public IList<StringSegment> Split(
int? maxLength = null,
StringSegmentSplitOptions options = default
)
Public Function Split (
Optional maxLength As Integer? = Nothing,
Optional options As StringSegmentSplitOptions = Nothing
) As IList(Of StringSegment)
public:
IList<StringSegment>^ Split(
Nullable<int> maxLength = nullptr,
StringSegmentSplitOptions options = StringSegmentSplitOptions()
)
member Split :
?maxLength : Nullable<int> *
?options : StringSegmentSplitOptions
(* Defaults:
let _maxLength = defaultArg maxLength null
let _options = defaultArg options new StringSegmentSplitOptions()
*)
-> IList<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.
IListStringSegmentA list of
StringSegment instances, whose elements contain the substrings in this
StringSegment that are
delimited by whitespace characters.