IIf

Public Function IIf(ByVal Condition As Boolean, ByVal TrueValue As Variant, ByVal FalseValue As Variant)

Instant if: Evaluates the condition and return the TrueValue when true, else the FalseValue. Please note that the TrueValue/FalseValue are only evaluated when needed (depending on the result of the condition).

Dim lHTML As String = $"<input type='text' name='MyControl' {IIf(pToolTip <> "", $"title = ""{EscapeStringToHTML(pToolTip)}""", "")}>"

Dim lAverage As Double = IIf(pCount = 0, 0, pSum / pCount) 'Note: The calculation pSum / pCount is not carried out (and will not raise an error) if pCount = 0