This documentation is archived and is not being maintained.

StringSplitOptions Enumeration

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

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

public enum class StringSplitOptions
/** @attribute FlagsAttribute() */ 
/** @attribute ComVisibleAttribute(false) */ 
public enum StringSplitOptions
public enum StringSplitOptions

 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 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 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 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 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0