Hi,
I'm new to C#. I have some sample code which works. I'm now trying to expand on it.
This code works:
$Name$ == "Consumer" ? "Green" : "Blue"
My understanding is that this is shorthand for "If the variable name is consumer then green, else blue".
I want to make this a nested if statement i.e. If the variable name is x then green, else if variable name is y then purble, else if variable name is z then grey, else if variable name is b then pink etc.
Any help in this shorthand syntax would be great.
Thanks a million
I'm new to C#. I have some sample code which works. I'm now trying to expand on it.
This code works:
$Name$ == "Consumer" ? "Green" : "Blue"
My understanding is that this is shorthand for "If the variable name is consumer then green, else blue".
I want to make this a nested if statement i.e. If the variable name is x then green, else if variable name is y then purble, else if variable name is z then grey, else if variable name is b then pink etc.
Any help in this shorthand syntax would be great.
Thanks a million