It is actually called a conditional statement and is referred to as "?:" On MSDN. This is basically a shortened notation for if-else
, except that it is actually an expression, not a statement. Since it is equivalent to if
, there are no caveats for this operator.
, , , Iif
VB.NET. , ,
Dim s As String = Iif(person Is Nothing, String.Empty, person.FirstName)
NullReferenceException
.