<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Takachan</author_name>
  <author_url>https://blog.hatena.ne.jp/Takachan/</author_url>
  <blog_title>PG日誌</blog_title>
  <blog_url>https://takap-tech.com/</blog_url>
  <categories>
    <anon>C#</anon>
    <anon>.NET Framework</anon>
    <anon>.NET Core</anon>
  </categories>
  <description>2つの変数の中身を入れ替える方法を4種類紹介したいと思います。 (1) 昔ながらの方法 (2) Tupleを使う (3) 外部のメソッドで入れ替える (4) 拡張メソッドで入れ替える(値型のみ)方法 ほかにあるかな？ 関連記事 (1) 昔ながらの方法 教科書に書いてあるやつ。最も一般的な方法。大抵の言語でもこうやって入れ替えられます。 int a = 10; int b = 20; int _tmp = a; a = b; b = _tmp; // &gt; a=20, b=10 ローカル変数がひとつ必要になります。以下のように中カッコのスコープを切って処理する小技もある。 int a = 10; …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakap-tech.com%2Fentry%2F2020%2F09%2F08%2F235451&quot; title=&quot;【C#】2つの変数の中身を入れ替える方法4選 - PG日誌&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-09-08 23:54:51</published>
  <title>【C#】2つの変数の中身を入れ替える方法4選</title>
  <type>rich</type>
  <url>https://takap-tech.com/entry/2020/09/08/235451</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
