Hi guys, Can we use Coalesce operator(??) and conditional ternary operator(:) in VB.NET as in C#?
+4
A:
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)
Nick Josevski
2009-03-10 05:52:18
*Note: using the if statement that way only applies in VB.NET 2008 and onwards.
Nick Josevski
2010-10-23 11:30:25
A:
'VB.Net Dim x as Integer = If(a, b, c) This code is not running. Giving an error as "There were build error"
Varsha
2010-07-10 06:31:19