ShippingConfirmationLabel.Text = _
string.Format("Using {0} shipping to:<br>", _
ShippingTypeRadioButtonList.SelectedValue);
This however works fine:
ShippingConfirmationLabel.Text = "Using " + ShippingTypeRadioButtonList.SelectedValue + "
shipping to:<br>";
Sorry if this question has been asked earlier however upon searching nothing concrete came up for this. For some reason that code doesn’t let me compile in VS.
Cheers
Andrew
There is no
Line Continuation Characterin C# like in VB.NETIn C# exist the
;to delimit the end of an instruction.This means that there is no need for a line continuation character since a line is not considered over until you reach a semi colon (“;”).
The
+is the string concatenation operator and it does not meansLine Continuation CharacterAs you can see, you could break the line at every point you like (of course not in the middle of a keyword or identifier) and close it with the
;terminator.Sometimes, for legibility or other reasons, you want to break apart a single string on different lines.
In this case you could use the string concatenation operator.