Landei00 Landei00 - 11 months ago 47
C# Question

How to make file path in required format?

I want to compare to images and have to make them first as a Bitmap.

Bitmap bmp1 = new Bitmap(file1);

file1 contains the path as a string in the following format:


But C# need to convert this in the following format:


Is there any possibility to convert the string to the needed format?

Answer Source

One way would be:

file1 = file1.Replace(@"\", @"\\");