erweiterung

This commit is contained in:
2023-03-23 15:55:13 +01:00
parent 33e49f846c
commit 09c8eab938
39 changed files with 1167 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
namespace BeispielExceptions2
{
internal class Program
{
static void Main(string[] args)
{
string[] strings = {"abc","def","ghi","jkl","mno","qpr","stu" };
PrintString(strings, 11);
}
/// <summary>
/// Eine lustig Zusammenfassung
/// </summary>
/// <param name="array"></param>
/// <param name="position"></param>
/// <exception cref="ArgumentOutOfRangeException"></exception>
static void PrintString(string[] array, int position)
{
if (position < 0 || position > array.Length)
{
throw new ArgumentOutOfRangeException(nameof(position), position, "Außerhalb des Arrays");
}
Console.WriteLine(array[position]);
}
}
}