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

StringSplitOptions Enumeration

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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
NoneThe return value includes array elements that contain an empty string
RemoveEmptyEntriesThe 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.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft