Sorry, difficult to give the question a proper title?
I'm basically appending a lot of text together to form the email body in my application from several radiobuttonlists in my web form. So my code looks like this:
StringBuilder body = new StringBuilder();
body.Append("<strong>For question1: </strong> " + ((rblQuestion1.SelectedIndex > -1) ? rblQuestion1.SelectedItem.Text : "") + "<br /><br />");
So my question is do I have to use the following syntax:
((rblQuestion1.SelectedIndex > -1) ? rblQuestion1.SelectedItem.Text : "")
Where what I really want is:
(rblQuestion1.SelectedIndex > -1) ? rblQuestion1.SelectedItem.Text
I don't need the empty string alternative if false, if you understand my point.
It's just me being a bit pedantic with my code really. Thanks in advance.