System.IO.Path.DirectorySeparatorChar Field

Provides a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization.

Syntax

public static readonly char DirectorySeparatorChar

Remarks

The character stored in this field cannot be in Path.InvalidPathChars. Path.AltDirectorySeparatorChar and DirectorySeparatorChar are both valid for separating directory levels in a path string.

The value of this field is a slash ("/") on UNIX, and a backslash ("\") on the Windows and Macintosh operating systems.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0