Skip to content

Instantly share code, notes, and snippets.

@huanlin
Last active March 24, 2020 16:12
Show Gist options
  • Save huanlin/3857eaf3a682ed72431283cf4f3ff485 to your computer and use it in GitHub Desktop.
Save huanlin/3857eaf3a682ed72431283cf4f3ff485 to your computer and use it in GitHub Desktop.
#nullable enable // 啟用 nullable 語法和警告
string? str1 = null;
#nullable disable // 關閉 nullable 語法和警告
string str2 = null;
#nullable enable
string str1 = null; // 編譯警告 CS8600
#nullable disable
string? str2 = null; // 編譯警告 CS8632
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment