System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string

前端 未结 5 2002
野趣味
野趣味 2020-12-18 03:25

I have this code. I am trying to retrieve just the text \"first program\". Considering that i know the index say 25 and total length of string is 35.

string          


        
5条回答
  •  抹茶落季
    2020-12-18 04:27

    Second argument to string.Substring() is the length, not the end-offset:

    Response.Write(text.Substring(25, 10));
    

提交回复
热议问题