Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a C# equivalent to File.separator in Java

Tags:

java

c#

How does C# cope with file separators? Is it always assumed the file separator is "\" (or "\\" and does this have to be escaped like this?

like image 986
peter.murray.rust Avatar asked Oct 08 '09 20:10

peter.murray.rust


People also ask

Why is there a slash in AC?

Senior Member. You read it as "ei-cee" (no "slash" pronounced). In terms of distinguishing between "air conditioning" and "air conditioner," I can think of an example like "Today, I bought a new air conditioner" ("conditioning" not allowed). I personally would not say "Today, I bought a new AC."

Why is it called AC?

Air conditioning, often abbreviated as A/C or AC, is the process of removing heat from an enclosed space to achieve a more comfortable interior environment (sometimes referred to as 'comfort cooling') and in some cases also strictly controlling the humidity of internal air.

What is the mean of AC?

a/ c is an abbreviation for air-conditioning. Keep your windows up and the a/c on high. 60 Motel Units. All Units A/C, Heat, Cable TV.

Is AC the same as AC?

The term “A/C” stands for “air conditioning,” but it's frequently used to describe any type of home cooling equipment, such as a traditional split-system air conditioner or heat pump, mini-split unit, geothermal system, or even a window unit.


2 Answers

I think Path.DirectorySeparatorChar is what you need. You can find it in the System.IO namespace.

like image 87
Geo Avatar answered Sep 29 '22 20:09

Geo


To combine paths use, and as suggested by Geo, this works in conjunction with DirectorySeparatorChar

IO.Path.Combine("path", "file.ext"); 
like image 32
Yannick Motton Avatar answered Sep 29 '22 21:09

Yannick Motton