In python we can ...
a = 5 if a == 5: pass #Do Nothing else: print "Hello World"
Is there a similar way to do this in C#?
Use empty braces.
int a = 5; if (a == 5) {} else { Console.Write("Hello World"); }
1.4m articles
1.4m replys
5 comments
57.0k users