Answers for "get directory for a file"

0

Get directory path of file path

string filePath = @"C:MyDirMySubDirmyfile.ext";
string directoryName = Path.GetDirectoryName(filePath);
Console.WriteLine($"GetDirectoryName('{filePath}') returns '{directoryName}'");

//This code produce the following output:
GetDirectoryName('C:MyDirMySubDirmyfile.ext') returns 'C:MyDirMySubDir'
Posted by: Guest on September-17-2021
0

get directory of a file linux

Signed-off-by: Dwaipayan Ray <[email protected]>
Posted by: Guest on February-08-2021

Code answers related to "get directory for a file"

Browse Popular Code Answers by Language