字符串格式问题

来源:百度知道 编辑:UC知道 时间:2024/06/24 18:26:20
listbox里有好几项内容比如中间某三项为第一个,第二个,第三个。每删除一项,字符串del纪录删除的此项内容,要求del纪录的格式为del=‘第一个’,‘第二个’,‘第三个’
请问该怎么实现呢?注意看清楚格式。

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int length=3;//具体更改
string del = "";
for (int i = 0; i < length-1; i++)
{
del += "'第" + i + "个',";

}

Console.WriteLine(del);

}
}
}