Coalesce operator and Conditional operator in VB.NET

user42348 picture user42348 · Mar 10, 2009 · Viewed 28k times · Source

Possible Duplicate:
Is there a conditional ternary operator in VB.NET?

Can we use the Coalesce operator(??) and conditional ternary operator(:) in VB.NET as in C#?

Answer

Nick Josevski picture Nick Josevski · Mar 10, 2009

I think you can get close with using an inline if statement:

//C#
int x = a ? b : c;

'VB.Net
Dim x as Integer = If(a, b, c)