C# Path DirectorySeparatorChar

Description

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

Syntax

Path.DirectorySeparatorChar has the following syntax.


public static readonly char DirectorySeparatorChar

Example

The following code example demonstrates the use of the DirectorySeparatorChar field.


//from   w w w .  j  a v a  2 s.  c om
using System;
using System.IO;
public class MainClass{
  public static void Main(String[] argv){  
    Console.WriteLine(Path.DirectorySeparatorChar);
  }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter