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."

posted @ 2010-04-06 00:09  greencolor  阅读(181)  评论(0编辑  收藏  举报