例如:
StringBuilder list1 = new StringBuilder();
StringBuilder list2 = new StringBuilder();
sb.Append("alert('Operation has been submitted, however, the following files were not valid and thus operations against their respective courses were not processed: "
+ if x == 1 display list1.ToString() else if x==2 display list2.ToString() +
". An email will be sent when the process has completed for any applicable valid course IDs.");
这甚至可能吗?
答案 0 :(得分:13)
string message = x == 1 ? "message1" : x == 2 ? "message2" : "message3"