string.Format

string output;
int selection = 5;

// Generate the output string
output = string.Format("You selected item {0} from the list.", selection);

Console.WriteLine(output);     // Outputs "You selected item 5 from the list."

原文地址:https://www.cnblogs.com/greencolor/p/1704989.html