删除数组中某一匹配项
string str = "1,2,3,4,5"; string[] strArray = str.Split(','); str = ""; for (int i = 0,k=0; i < strArray.Length; i++) { if (strArray[i] != "2") { if (i == 0) { str = strArray[i]; } else { str += "," + strArray[i]; } k++; } } Response.Write(str); Response.End();