小编Han*_* K.的帖子

这段代码怎么可能:"ArgumentOutOfRangeException:startIndex不能大于字符串的长度"?

我的C#代码中有以下方法:

/// <summary>
/// Removes the first (leftmost) occurence of a <paramref name="substring"/> from a <paramref name="string"/>.
/// </summary>
/// <param name="string">The string to remove the <paramref name="substring"/> from. Cannot be <c>null</c>.</param>
/// <param name="substring">The substring to look for and remove from the <paramref name="string"/>. Cannot be <c>null</c>.</param>
/// <returns>
/// The rest of the <paramref name="string"/>, after the first (leftmost) occurence of the <paramref name="substring"/> in it (if any) has been removed.
/// </returns>
/// <remarks>
/// <list type="bullet"> …
Run Code Online (Sandbox Code Playgroud)

.net c# debugging substring exception

17
推荐指数
1
解决办法
3165
查看次数

标签 统计

.net ×1

c# ×1

debugging ×1

exception ×1

substring ×1