<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>xin9le</author_name>
  <author_url>https://blog.hatena.ne.jp/xin9le/</author_url>
  <blog_title>xin9le.net</blog_title>
  <blog_url>https://xin9le.hatenablog.jp/</blog_url>
  <categories>
    <anon>.NET</anon>
    <anon>Tips</anon>
  </categories>
  <description>久々に Path.GetDirectoryName() を使ったら、件名の通りの挙動に引っ掛かりました。文章で説明するよりもサンプルコードを見た方が早いので、以下をご覧ください。 const string fileName = &quot;A/B/C/D.cs&quot;; var dir1 = Path.GetDirectoryName(fileName); dir1.Dump(&quot;string&quot;); // A\B\C var dir2 = Path.GetDirectoryName(fileName.AsSpan()); dir2.Dump(&quot;ReadOnlySpan&lt;char&gt;&quot;); // A/B/C ご覧の…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fxin9le.hatenablog.jp%2Fentry%2F2023%2F11%2F20%2F212653&quot; title=&quot;Path.GetDirectoryName() は overload によって挙動が異なる - xin9le.net&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/x/xin9le/20231120/20231120210939.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-11-20 21:26:53</published>
  <title>Path.GetDirectoryName() は overload によって挙動が異なる</title>
  <type>rich</type>
  <url>https://xin9le.hatenablog.jp/entry/2023/11/20/212653</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
