C# char "//" path separator
Is there possible to use char "//" another there I did it? I looked for in Path, but I can't find it.
string separator = "//";
I mean '/'.
static string sep = System.IO.Path.PathSeparator.ToString();
but it returns: ';'. Why?
Path.DirectorySeparatorChar gives you the character used to separate directories in a path, i.e. you use it in paths.
Path.PathSeparator gives you the character used to separate paths in environment variables, i.e. you use it between paths.
For example your system's PATH environment variable will typically list multiple paths where the the OS will look for applications to run.
On Windows Path.PathSeparator is ;, and Path.DirectorySeparatorChar is \, two paths would be stored in an environment variable like this:
It's read only, you can't change it. A Path represents a path that the operating system running the framework and your application understands. If you use any other value, the OS won't understand it. There's no OS in the world which understands "a//b//c" paths. But you can have arbitrary strings which contain paths like that, except they won't be OS-understandable file paths, and you can call them something else.
It's equal to Path.PathSeparator, it's better to use this,