tags:

views:

248

answers:

2

Is there some built-in constant for the path delimiter (i.e. \ vs /)

+9  A: 

System.IO.Path has these sort of information.

http://msdn.microsoft.com/en-us/library/system.io.path.directoryseparatorchar.aspx

Mikko Rantanen
+3  A: 

System.IO.Path has two readonly fields for this purpose:

Then there are two additional fields for the volume separator and path separator:

  • Path.VolumeSeparatorChar: the character used to separate the volume name/drive letter from the rest of tha path (':' on windows, '/' on UNIX)
  • Path.PathSeparator: the character used to separate multiple paths (';')
M4N