Cross-platform file name handling in .NET Core

You can also use Path.DirectorySeparatorChar as below:

 Console.WriteLine("..{0}Data{0}uploads{0}{{filename}}", Path.DirectorySeparatorChar);

Reference: MSDN

Leave a Comment