StringSplitOptions Enumeration
TOC
Collapse the table of content
Expand the table of content

StringSplitOptions Enumeration

 

Specifies whether applicable String.Split method overloads include or omit empty substrings from the return value.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

[<ComVisibleAttribute(false)>]
[<FlagsAttribute>]
type StringSplitOptions

Member nameDescription
None

The return value includes array elements that contain an empty string

RemoveEmptyEntries

The return value does not include array elements that contain an empty string

The String.Split method returns an array of the substrings in a given string that are delimited by specified characters or strings. Adjacent delimiters yield an array element that contains an empty string (""). The values of the StringSplitOptions enumeration specify whether an array element that contains an empty string is included in the returned array.

Specify the None value to invoke the default behavior of the String.Split method, which is to return an array of both empty substrings and substrings that are not empty. Specify the RemoveEmptyEntries value to cause the String.Split method to return an array consisting solely of substrings that are not empty.

The following code example uses the StringSplitOptions enumeration to include or exclude substrings generated by the String.Split method.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft