日期:2014-05-17 浏览次数:21134 次
private string Delete(string str, int delIndex)
{
string[] arry = str.Split(';');
if (delIndex > arry.Length)
return str;
string strRet = string.Empty;
for (int i = 0; i < arry.Length; i++)
{
if (i + 1 != delIndex)
{
strRet += arry[i];
if (i < arry.Length - 1)
strRet += ";";
}
}
return strRet;
}
string str = "sdaf;adsfad;dd;dee;ddd;";
str = Delete(str, 3);