This is what I'd like to do:
string x = if(true) "String Val" else "No String Val";
Is that possible?
This is what I'd like to do:
string x = if(true) "String Val" else "No String Val";
Is that possible?
What you're talking about is called a conditional statement:
string x = boolVal ? "String Val" : "No String Val";
If you really want the string to have no value if the bool is false, you could change to:
string x = boolVal ? "String Val" : null;
string x = condition ? trueValue : falseValue;