Arrays, Lists, Indexing, and Foreach [Pt 13] | C# for Beginners
Vložit
- čas přidán 9. 11. 2023
- View full playlist: aka.ms/dotnet/beginnervideos/...
Set up C# in VS Code: aka.ms/dotnet/get-started/vscode
🏆Earn the C# Certification: aka.ms/csharp-certification
David and Scott continue our conversation about Lists and another new topic, arrays! Learn about the similarities and differences between these structures and when to use each of them.
Links:
.NET Beginner Videos: aka.ms/dotnetvideos
MS Learn: aka.ms/dotnet/beginnervideos/...
Blog: aka.ms/dotnet/blog
Twitter: aka.ms/dotnet/twitter
TikTok: aka.ms/dotnet/tiktok
Mastodon: aka.ms/dotnet/mastodon
LinkedIn: aka.ms/dotnet/linkedin
Facebook: aka.ms/dotnet/facebook
Docs: learn.microsoft.com/dotnet
Forums: aka.ms/dotnet/forums
🙋♀️Q&A: aka.ms/dotnet-qa
👨🎓Microsoft Learn: aka.ms/learndotnet
#dotnet #csharp - Věda a technologie
Gets index out of range exception
: "You told me to read these things ... but i'm just gonna panic and not read"
Me: 🤣😂
You guys are the best at teaching concepts!!!!
These lectures are great
Excellent teachers
2:25 [Ctrl] + [/] is a better commenting hotkey, albeit the one in the video is good to know b/c it is used in other Microsoft platforms such as SSMS.
i dont know if im learning c#, how to use vs code or learning english. (im brazilian)
var names = new List() { "Kevin", "Joseph", "Raul", "Marco" };
names.Add("Sophia");
names.Add("Lucy"); // add bucket
Console.WriteLine(names[names.Count-1]); // last element
Console.WriteLine(names[^1]); // count from the back.
Console.WriteLine();
foreach (var name in names[2..4]) // ranges
{
Console.WriteLine(name);
}
Console.WriteLine();
var people = new string[] { "Kevin", "Joseph", "Raul", "Marco" }; // array
people = [..people, "Sophia", "Lucy"]; // new bucket
people.ToList().ForEach(x => Console.WriteLine(x));
names[^2] looks weird, names [-2] is more cleaner