C# - if statement (shorthand)

In normal statement, we use if statement :

Boolean _valid = false;
if (_command.ToLower() == "get_data")
     _valid = true;
else
     _valid = false;


We can use the shorthand statement:
     _valid = _command.ToLower() == "get_data"? true : false;

Popular posts from this blog

SAP CPI - Loop Process Call with SuccessFactor (oData V2)

Setting IntelliJ IDEA to run Groovy Script

C# - BASE64 to Image