日期:2014-05-17 浏览次数:20445 次
[align=left] string TargeStr = ",1,5,9,13,15,17,19,21,"; if (TargeStr.StartsWith(",") == true) { string[] strArray = TargeStr.Trim(new char[] { ',' }).Split(','); for (int i = 0; i < strArray.Length; i++) { Response.Write("Index of " + i + " : " + strArray[i] + "<br>"); } }[/align]
------解决方案--------------------
[Quote=引用:]
string TargeStr = ",1,5,9,13,15,17,19,21,"; if (TargeStr.StartsWith(",") == true) { string[] strArray = TargeStr.Trim(new char[] { ',' }).Split(','); for (int i = 0; i < strArray.Length; i++) { Response.Write("Index of " + i + " : " + strArray[i] + "<br>"); } }
------解决方案--------------------