当前位置: 代码迷 >> ASP.NET >> startIndex 不可以大於字串的長度。參數名稱: startIndex解决思路
  详细解决方案

startIndex 不可以大於字串的長度。參數名稱: startIndex解决思路

热度:7875   发布时间:2013-02-25 00:00:00.0
startIndex 不可以大於字串的長度。參數名稱: startIndex
startIndex 不可以大於字串的長度。參數名稱: startIndex

------解决方案--------------------------------------------------------
看下集合是不是为空,你还是用Items[0] 了...超出集合的长度了
------解决方案--------------------------------------------------------
是不是你在截取字符串的时候,比如:
s.SubString(这个参数过大,10)
呵呵。
------解决方案--------------------------------------------------------
问题就是你给的startIndex超过字符串长度了啊

你是在substring还是查找,把代码贴出来看看
------解决方案--------------------------------------------------------



startIndex 从零开始索引,你先看看是否越界了.