LoginSignup
2
3

More than 5 years have passed since last update.

C#をはじめて調べたこと

Last updated at Posted at 2018-12-05

2018年4月ごろまでは仕事でVB.NETを使っていて、新しい言語仕様も大して取り入れず適当なコードを書いてましたが
2018年9月ごろから趣味でC#を使い始めてよくわからず調べたことをメモ的にまとめています。
なお個人的にVBのときに使っていなかっただけで、C#固有のものというわけではありません。
(ある意味当たり前ですが、ほとんどVBにも同じ構文は存在します。)

個人的なメモとして書いていますので、くだらない記事を読んだと怒らないようお願いします。
随時更新です。

非同期処理

https://qiita.com/rawr/items/5d49960a4e4d3823722f
https://qiita.com/TsuyoshiUshio@github/items/e9404651c9e48f1b8443

var(使いどころ)

https://qiita.com/hollydad/items/1516a3f13147a754b9db
https://qiita.com/Nossa/items/e5e50d2fc1ae8b3e2389

クラスをnewしたときに値をセットする(オブジェクト初期化子)

null合体演算子、null条件演算子

null合体→ a ?? b 「aがnullならbを返す」
null条件→ a?.property,a?[1]「aがnullでもヌルポにならずnullを返す」
合わせ技 a?.property ?? "default"
https://qiita.com/Nossa/items/1fd4881a0b97a5f32901

タプル

http://ryuichi111std.hatenablog.com/entry/2017/03/12/175357
http://ryuichi111std.hatenablog.com/entry/2016/12/22/011853

オプション引数(VBでいうところのOptional)

stringの@とか$とか

@は逐語的文字列という
$は補完文字列という
http://csharpvbcomparer.blogspot.com/2016/05/csharp-string-literal-summary-interpolation-and-verbatim.html

ラムダ式とLINQ

https://qiita.com/m-gen/items/ebe59422affc69a92429
https://qiita.com/stokes_dotnet/items/a70c33911ad96e5d8188

色々まとめて

2
3
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
2
3