Skip to content

Instantly share code, notes, and snippets.

@yutopp
Created October 2, 2021 10:32
Show Gist options
  • Save yutopp/05a387f866742eeb948dd52bdefee584 to your computer and use it in GitHub Desktop.
Save yutopp/05a387f866742eeb948dd52bdefee584 to your computer and use it in GitHub Desktop.
https://www.jdoodle.com/compile-c-sharp-online/
mono 5.10.1
```
path = tmp/aaa
parentPath = tmp
```
https://www.jdoodle.com/compile-c-sharp-online/
mono 6.0.0
```
path = tmp/aaa
parentPath = /home/tmp
```
using System;
using System.IO;
class Program
{
static void Main() {
var path = "tmp/aaa";
System.Console.Write($"path = {path}\n");
var parentPath = Directory.GetParent(path).ToString();
System.Console.Write($"parentPath = {parentPath}\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment