在用Substring的系统报错????????
cid 2003-09-10 12:20:33 我在从某一个数组中截取一个字符传但系统报错?
代码
数组在前面已经做过判断时候有数据!
if (arrY[h].IndexOf('+') != -1)
{
arr = arrY[h].Split('+');
if (arr[0].ToString() != "empty")
{
//出错地方 if (tmp_date == arr[0].ToString().Substring(0,6))
{
if (my_Date.Convert_DateStart(arr[0].ToString(),mj_DTData_main.Rows[i][0].ToString()) != "pass")
报错信息:
Index and length must refer to a location within the string. Parameter name: length
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. Parameter name: length