The System.Collections.Generic namespace in C# provides various classes and interfaces for working with collections of data. One of the most useful classes is the List class, which provides a dynamic, resizable list that can hold elements of any type T.
Here are some examples of using List:
// Create a new list of strings List myList = new List();
// Add some elements to the list myList.Add("hello"); myList.Add("world"); myList.Add("!");
// Print out the elements of the list foreach (string s in myList) { Console.WriteLine(s); }
// Find the index of an element in the list int index = myList.IndexOf("world");
// Remove an element from the list myList.Remove("!");
// Check if the list contains a certain element bool contains = myList.Contains("hello");
In the above examples, we're using methods like Add, IndexOf, Remove, and Contains to add elements to the list, find the index of an element, remove an element from the list, and check if the list contains a certain element.
The System.Collections.Generic namespace is part of the .NET Framework Class Library.
C# (CSharp) System.Collections.Generic System.Collections.Generic.List.Find - 23 examples found. These are the top rated real world C# (CSharp) examples of System.Collections.Generic.System.Collections.Generic.List.Find extracted from open source projects. You can rate examples to help us improve the quality of examples.