-
-
Save HamidMosalla/20b55745b15ee3120122eb02174723fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int GetValueFromArray(int[] array, int index) | |
{ | |
try | |
{ | |
return array[index]; | |
} | |
catch (System.IndexOutOfRangeException ex) | |
{ | |
throw new ArgumentOutOfRangeException("Index is out of range", "index", ex); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment