文字列の最初の 200 語を抽出しようとしていますが、次のエラーが発生することがあります。
"Index and length must refer to a location within the string. Parameter name: length"
コードは次のとおりです。
int i = GetIndex(fullarticle, 200);
string result = fullarticle.Substring(0, i);
これを修正するにはどうすればよいですか?