Solution 1: Get the total number of elements in a collection and then check the upper bound of a collection is one less than its number of elements.
The following example shows how to fix
IndexOutOfRange exception:
C# C# 1001 notes @csharp_1001_notes · 6.66K subscribers IndexOutOfRange exception: