StringSplitOptions Enumeration

Specifies whether methods that split delimited substrings include or omit empty substrings from the returned array.

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

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

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

Member nameDescription
Supported by Silverlight for Windows PhoneSupported by Xbox 360NoneThe return value includes array elements that contain an empty string
Supported by Silverlight for Windows PhoneSupported by Xbox 360RemoveEmptyEntriesThe return value does not include array elements that contain an empty string

The String::Split(array<Char>, StringSplitOptions) and String::Split(array<String>, StringSplitOptions) methods return 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 StringSplitOptions::None value to invoke the default behavior of the Split method, which is to return an array of both empty substrings and substrings that are not empty. Specify the StringSplitOptions::RemoveEmptyEntries value to cause the 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 Split method.

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

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: