LoginSignup
0
0

More than 3 years have passed since last update.

Path.Combineであっぷっぷ☆(^~^)!

Posted at
var fullName = Path.Combine("C:\This\Is", "A\Pen.txt");

// 多分 C:\This\Is\A\Pen.txt

うろおぼえだが C#で こんな書き方ができたと思う。

var fullName = Path.Combine("C:\This\Is", "\A\Pen.txt");

// 多分 C:\A\Pen.txt

こうして わたしのCドライブには色んなフォルダーが作られた。

var fullName = Path.Combine("C:\This\Is", "\A\Pen.txt".TrimStart('/', '\\'));

// 多分 C:\This\Is\A\Pen.txt

なんということだぜ。おわり。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0