c sharp check if list contains

C#
// To check if a list contains a certain value, use Contains():

// Creating an List<T> of Integers 
List<int> firstlist = new List<int>(); 
  
// Adding elements to List 
firstlist.Add(1); 
firstlist.Add(2); 
firstlist.Add(3); 
firstlist.Add(4); 
firstlist.Add(5); 
  
// Checking whether 4 is present in List or not 
Console.Write(firstlist.Contains(4)); 
Source

Also in C#: