Saturday, 5 March 2011

How to use '?:' operator in if condition

C#

string Abs;
Abs = Abs != "" ? "abc" : "cba";
VB

Dim Abs As String
Abs = If(Abs <> "", "abc", "cba")

No comments:

Post a Comment