Add a C# course with a side-by-side code runner.

Each lesson explains a topic and runs the edited program next to the text through the local .NET SDK.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pepaskopec-blip 2026-10-11 14:37:14 +02:00
commit 333085ee53
86 changed files with 2482 additions and 5 deletions

View file

@ -0,0 +1,39 @@
---
id: cs-4-list
nazev: List
popis: Seznam, který umí růst.
---
# Výklad
## Přidávání
*Add*
- List<string> začne prázdný. Add přidá na konec.
- Count je počet. Indexy jsou zase od nuly.
- Na rozdíl od pole délku dopředu neříkáte.
> Tip: List<string> potřebuje špičaté závorky s typem prvku.
## Odebrání
*Remove*
- Remove("Eva") odebere první Evu.
- RemoveAt(0) odebere podle indexu.
- foreach pak projde, co zůstalo.
> Tip: Přidejte třetí jméno před odebráním.
# Kód
```
List<string> jmena = new List<string>();
jmena.Add("Anna");
jmena.Add("Eva");
jmena.Remove("Eva");
foreach (string j in jmena)
{
Console.WriteLine(j);
}
Console.WriteLine(jmena.Count);
```