string tmp = {condition} ? {return value if TRUE} : {return value if FALSE}
var rand = new Random();
var condition = rand.NextDouble() > 0.5;
// int? 로 표기하여, int에 null을 넣을 수 있음
int? x = condition ? 12 : null;
IEnumerable<int> xs = x is null ? new List<int>() { 0, 1 } : new int[] { 2, 3 };
https://skuld2000.tistory.com/17
skuld2000.tistory.com
learn.microsoft.com
https://www.csharpstudy.com/CS6/CSharp-null-conditional-operator.aspx
www.csharpstudy.com
https://learn.microsoft.com/ko-kr/dotnet/csharp/language-reference/operators/conditional-operator
learn.microsoft.com
0 댓글